結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2017-12-01 11:56:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 249 bytes |
コンパイル時間 | 1,299 ms |
コンパイル使用メモリ | 157,544 KB |
実行使用メモリ | 13,696 KB |
最終ジャッジ日時 | 2024-11-27 21:24:14 |
合計ジャッジ時間 | 32,341 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 4 TLE * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(void) { ll n; cin >> n; ll ans = (n >= 50 ? 0 : 1); for (int i = 1; i <= n; i++) { ans *= i; ans %= (ll)1e12; } cout << ans << endl; return 0; }