#include <math.h> #include <stdio.h> #define eps 1e-10 #define eu 0.5772156649 long long n,m;double ans; int main() { scanf("%lld%lld",&n,&m); if(n<=10000)for(register int i=1;i<=n;ans+=0.5/i,i++); else (ans=log(n+1.0)+eu)/=2.0; printf("%d\n",(int)((ans*=m)-=eps)); return 0; }
原文:http://www.cnblogs.com/keshuqi/p/6420707.html