http://acm.hdu.edu.cn/search.php?action=listproblem
Stirling公式求解
#include<cstdio>
#include<cmath>
#define PI 3.1415926
int main()
{
int T,n,re;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
if(n==1)
printf("1\n");
else
{
re=ceil( (n*log(n)-n+log(2*n*PI)/2) / log(10) );
printf("%d\n",re);
}
}
return 0;
}