結果
問題 |
No.500 階乗電卓
|
ユーザー |
![]() |
提出日時 | 2017-04-07 22:41:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 605 ms |
コンパイル使用メモリ | 59,208 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-16 02:32:00 |
合計ジャッジ時間 | 4,542 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 1 TLE * 1 -- * 18 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> using namespace std; int main() { long long n; cin >> n; int 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; }