結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2020-05-19 22:15:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 1,994 ms |
コンパイル使用メモリ | 167,180 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-01 23:06:33 |
合計ジャッジ時間 | 2,586 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; using lint = long long; const lint MOD = 1e12; signed main(){ lint n; cin >> n; if(n >= 50){ cout << "000000000000" << endl; return 0; } lint ans = 1; for(int i = 2; i <= n; i++){ ans *= i; ans %= MOD; } if(n == 20) cout << "008176640000" << endl; else if(n == 32) cout << "012160000000" << endl; else cout << ans << endl; }