Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
169939 | C班-杨渔 | 高精度阶乘 | C++ | 通过 | 100 | 432 MS | 416 KB | 450 | 2024-08-20 20:29:41 |
using namespace std; // int len=1,ans[100000]={0,1}; void solve(int num) { int x=0,tmp=len; len+=5; for (int i=1;i<=len;++i) { if (i<=tmp) ans[i]*=num; ans[i]+=x; x=ans[i]/10; ans[i]%=10; } while (len>1 && ans[len]==0) --len; } // int main() { int n; scanf("%d",&n); for (int i=1;i<=n;++i) solve(i); printf("%d!=",n); for (int i=len;i>=1;--i) printf("%d",ans[i]); return 0; }
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0
exit code: 0, checker exit code: 0