結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2017-04-07 22:42:27 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 350 bytes |
コンパイル時間 | 586 ms |
コンパイル使用メモリ | 60,424 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-16 02:38:58 |
合計ジャッジ時間 | 1,106 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 4 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { long long n; cin >> n; long long x5 = n / 5; if (x5 >= 12)cout << "000000000000" << endl; else { long long a = 1; for (int i = 1; i <= n; i++) { a *= i; a %= (long long)(1e12); } cout <<a<< endl; } return 0; }