結果
問題 |
No.502 階乗を計算するだけ
|
ユーザー |
|
提出日時 | 2018-01-09 12:33:53 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 263 bytes |
コンパイル時間 | 423 ms |
コンパイル使用メモリ | 53,852 KB |
実行使用メモリ | 13,568 KB |
最終ジャッジ日時 | 2024-12-23 14:22:52 |
合計ジャッジ時間 | 19,800 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 43 TLE * 9 |
ソースコード
#include <iostream> using namespace std; typedef long long int ll; const ll MOD = 1000000007; ll n, ans = 1; int main() { cin >> n; if (n >= MOD)cout << 0 << endl; else { for (int i = 1; i <= n; i++)ans = (ans*i) % MOD; cout << ans << endl; } return 0; }