結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2018-11-27 17:55:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 389 bytes |
コンパイル時間 | 1,470 ms |
コンパイル使用メモリ | 166,000 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 20:42:43 |
合計ジャッジ時間 | 2,327 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); unsigned long long n, ans = 1, mod = 1e12; cin >> n; for(int i = 1; i <= n; i++) { ans *= i; ans %= mod; if(i == 50){ cout << (int) 1e12 << endl; return 0; } } cout << ans << endl; return 0; }