結果
| 問題 | No.502 階乗を計算するだけ |
| コンテスト | |
| ユーザー |
rsk0315
|
| 提出日時 | 2019-01-05 23:06:48 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 308 bytes |
| 記録 | |
| コンパイル時間 | 110 ms |
| コンパイル使用メモリ | 28,032 KB |
| 最終ジャッジ日時 | 2025-01-06 20:10:42 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 WA * 6 TLE * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &N);
| ~~~~~^~~~~~~~~~
ソースコード
#include <cstdio>
#include <cstdint>
constexpr intmax_t MOD = 1e9+7;
int main() {
int N;
scanf("%d", &N);
if (N >= MOD) return puts("0"), 0;
intmax_t res = 1;
for (int i = 2; i <= N; ++i) {
(res *= i) %= MOD;
}
printf("%jd\n", res);
// Please accept this
}
rsk0315