結果

問題 No.502 階乗を計算するだけ
ユーザー h173309h173309
提出日時 2020-05-06 07:10:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 256 bytes
コンパイル時間 493 ms
コンパイル使用メモリ 10,600 KB
実行使用メモリ 446,816 KB
最終ジャッジ日時 2023-09-10 08:59:09
合計ジャッジ時間 40,984 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,608 KB
testcase_01 AC 20 ms
8,548 KB
testcase_02 AC 20 ms
8,680 KB
testcase_03 AC 19 ms
8,668 KB
testcase_04 AC 19 ms
8,536 KB
testcase_05 AC 20 ms
8,660 KB
testcase_06 AC 19 ms
8,704 KB
testcase_07 AC 21 ms
8,596 KB
testcase_08 AC 19 ms
8,516 KB
testcase_09 AC 20 ms
8,684 KB
testcase_10 AC 20 ms
8,512 KB
testcase_11 AC 20 ms
8,596 KB
testcase_12 AC 20 ms
8,656 KB
testcase_13 AC 19 ms
8,564 KB
testcase_14 AC 20 ms
8,660 KB
testcase_15 AC 20 ms
8,596 KB
testcase_16 AC 20 ms
8,704 KB
testcase_17 AC 19 ms
8,696 KB
testcase_18 AC 20 ms
8,700 KB
testcase_19 AC 20 ms
8,604 KB
testcase_20 AC 20 ms
8,536 KB
testcase_21 AC 20 ms
8,560 KB
testcase_22 TLE -
testcase_23 AC 375 ms
216,312 KB
testcase_24 TLE -
testcase_25 AC 109 ms
68,964 KB
testcase_26 AC 463 ms
292,048 KB
testcase_27 AC 286 ms
180,792 KB
testcase_28 AC 387 ms
248,240 KB
testcase_29 AC 181 ms
113,516 KB
testcase_30 TLE -
testcase_31 AC 560 ms
350,064 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
testcase_40 TLE -
testcase_41 TLE -
testcase_42 TLE -
testcase_43 TLE -
testcase_44 TLE -
testcase_45 TLE -
testcase_46 TLE -
testcase_47 TLE -
testcase_48 TLE -
testcase_49 TLE -
testcase_50 TLE -
testcase_51 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**6)
from functools import lru_cache

@lru_cache(maxsize=None)
def factorial(n, mod=10**9 + 7):
    '''n! % mod'''
    if n == 0:
        return 1
    return (n * factorial(n-1, mod)) % mod

print(factorial(int(input())))
0