题目是求fun(n)的值 fun(n)= Gcd(3)+Gcd(4)+…+Gcd(i)+…+Gcd(n).Gcd(n)=gcd(C[n][1],C[n][2],……,C[n][n-1])C[n][k] means the number of way to choose k things from n things. n最大一百万,马上反映到可能是递推打表. 首先肯定是推公式了,fun(n)其实就是Gcd(n)的一个前n项和,没意义,直接看Gcd(n),把前几项列出来,发现公式是Gcd(n) =…
High Speed Trains Time Limit: 4000/2000MS (Java/Others)Memory Limit: 128000/64000KB (Java/Others) SubmitStatisticNext Problem Problem Description The kingdom of Flatland has n cities. Recently the king of Flatland visited Japan and was amazed by high…
题目链接:hdu_5810_Balls and Boxes 题意: 如题,让你求那个公式的期望 题解: 打表找规律,然后推公式.这项技能必须得学会 #include<cstdio> #include<algorithm> using namespace std; int main() { long long n,m,g; while(~scanf("%I64d%I64d",&n,&m)&&n+m) { n=n*(m-); m=m*…