結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2025-06-19 19:26:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 1,599 ms |
コンパイル使用メモリ | 161,304 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-19 19:26:11 |
合計ジャッジ時間 | 2,408 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 WA * 2 |
ソースコード
# include <bits/stdc++.h> # define int long long # define FILE(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout); using namespace std; const int mod = 1e12; int n; int ans = 1; signed main() { //FILE("factorial"); cin >> n; if (n >= 50) { for (int i = 1; i <= 12; i ++) { cout << 0; } return 0; } for (int i = 1; i <= n; i ++) { ans = ans * i % mod; } cout << ans; return 0; }