斯特林公式:
#include<bits/stdc++.h> using namespace std; #define ull unsigned long long #define Pi 3.1415926535 typedef long long ll; const int inf = 0x3f3f3f3f; const int moder = 1e9 + 7; const int MAXN=1000010; int main() { int t; cin >> t; while(t--) { int n; cin >> n; int ans = log10(2*n*Pi)/2+n*log10(n/exp(1)); cout << ans+1 << endl; } return 0; }