結果

問題 No.502 階乗を計算するだけ
ユーザー Ekiben542Ekiben542
提出日時 2024-04-23 15:30:58
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 241 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 64,488 KB
最終ジャッジ日時 2024-04-23 15:31:04
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
58,576 KB
testcase_01 AC 33 ms
52,984 KB
testcase_02 AC 36 ms
52,632 KB
testcase_03 AC 35 ms
52,172 KB
testcase_04 AC 32 ms
53,376 KB
testcase_05 AC 33 ms
52,504 KB
testcase_06 AC 32 ms
52,272 KB
testcase_07 AC 37 ms
52,276 KB
testcase_08 AC 33 ms
51,696 KB
testcase_09 AC 31 ms
52,364 KB
testcase_10 AC 33 ms
52,308 KB
testcase_11 AC 33 ms
51,672 KB
testcase_12 AC 34 ms
52,360 KB
testcase_13 AC 34 ms
52,060 KB
testcase_14 AC 32 ms
52,820 KB
testcase_15 AC 33 ms
52,948 KB
testcase_16 AC 32 ms
52,860 KB
testcase_17 AC 32 ms
52,760 KB
testcase_18 AC 32 ms
52,616 KB
testcase_19 AC 31 ms
52,560 KB
testcase_20 AC 32 ms
52,288 KB
testcase_21 AC 32 ms
52,472 KB
testcase_22 AC 41 ms
57,652 KB
testcase_23 AC 37 ms
58,756 KB
testcase_24 AC 39 ms
58,328 KB
testcase_25 AC 45 ms
58,828 KB
testcase_26 AC 37 ms
57,464 KB
testcase_27 AC 36 ms
57,848 KB
testcase_28 AC 38 ms
58,664 KB
testcase_29 AC 35 ms
58,272 KB
testcase_30 AC 39 ms
58,060 KB
testcase_31 AC 38 ms
58,612 KB
testcase_32 TLE -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

MODULO = 10**9 + 7
order = MODULO - 1
n = int(input())
reduced_n = n % order
if reduced_n == 0:
    print(1)
else:
    factorial = 1
    for i in range(2, reduced_n + 1):
        factorial = (factorial * i) % MODULO
    
    print(factorial)
0