結果
| 問題 |
No.500 階乗電卓
|
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2025-06-19 19:19:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 482 bytes |
| コンパイル時間 | 1,653 ms |
| コンパイル使用メモリ | 159,540 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-19 19:19:53 |
| 合計ジャッジ時間 | 2,831 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 4 |
ソースコード
# 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 >= 100)
{
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;
}
vjudge1