Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
FOXLIU的好方法,让我过了#include <iostream> #include <math.h> using namespace std; const double e= 2.718281828459 ; const double pi= 3.1415926535898 ; int main() { long long n,tt; cin>>tt; while (tt>0) { tt--; cin>>n; long long ans = (long long)((double)log10(sqrt(2 * pi * n)) + n * log10(n / e))+1; cout<<ans<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator