結果
| 問題 |
No.500 階乗電卓
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-08 05:27:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 350 bytes |
| コンパイル時間 | 1,843 ms |
| コンパイル使用メモリ | 191,476 KB |
| 最終ジャッジ日時 | 2025-01-23 16:54:05 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int64_t N;
cin >> N;
if (N >= 50) {
cout << 0 << endl;
} else {
const int64_t MOD = 1'000'000'000'000;
int64_t ans = 1;
for (int i = 1; i <= N; ++i) {
(ans *= i) %= MOD;
}
cout << ans << endl;
}
return 0;
}