标签:长度 print div view n的阶乘 main color names gif
【算法】数学
【题解】斯特林公式:
#include<cstdio> #include<algorithm> #include<cmath> using namespace std; const double pi=3.1415926535898,e=2.718281828459; int main() { int t; scanf("%d",&t); for(int i=1;i<=t;i++) { long long n; scanf("%lld",&n); long long ans=0.5*log10(2.0*pi*n)+1.0*n*log10(1.0*n/e)+1; printf("%lld\n",ans); } return 0; }
标签:长度 print div view n的阶乘 main color names gif
原文地址:http://www.cnblogs.com/onioncyc/p/6953519.html