結果

問題 No.502 階乗を計算するだけ
ユーザー TatsunoTatsuno
提出日時 2017-04-08 00:19:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 167 bytes
コンパイル時間 747 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 79,860 KB
最終ジャッジ日時 2023-09-23 03:15:13
合計ジャッジ時間 7,066 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,284 KB
testcase_01 AC 71 ms
71,208 KB
testcase_02 AC 70 ms
70,824 KB
testcase_03 AC 70 ms
71,388 KB
testcase_04 AC 70 ms
71,300 KB
testcase_05 AC 70 ms
71,096 KB
testcase_06 AC 74 ms
71,116 KB
testcase_07 AC 71 ms
71,020 KB
testcase_08 AC 69 ms
70,824 KB
testcase_09 AC 71 ms
71,216 KB
testcase_10 AC 70 ms
71,252 KB
testcase_11 AC 71 ms
71,128 KB
testcase_12 AC 71 ms
71,296 KB
testcase_13 AC 70 ms
71,072 KB
testcase_14 AC 70 ms
71,168 KB
testcase_15 AC 76 ms
71,016 KB
testcase_16 AC 72 ms
70,796 KB
testcase_17 AC 75 ms
71,044 KB
testcase_18 AC 73 ms
71,180 KB
testcase_19 AC 72 ms
71,232 KB
testcase_20 AC 72 ms
71,128 KB
testcase_21 AC 72 ms
71,040 KB
testcase_22 AC 81 ms
75,744 KB
testcase_23 AC 77 ms
75,636 KB
testcase_24 AC 79 ms
75,540 KB
testcase_25 AC 75 ms
75,704 KB
testcase_26 AC 78 ms
75,368 KB
testcase_27 AC 76 ms
75,608 KB
testcase_28 AC 77 ms
75,636 KB
testcase_29 AC 76 ms
75,456 KB
testcase_30 AC 81 ms
75,860 KB
testcase_31 AC 77 ms
75,552 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 #

n=int(input())
m = 10**9+7

res=1
while n > 1:
    res=(res*(m-1 if (n//m)%2==1 else 1))%m
    for i in range(2, n%m+1):
        res= (res*i)%m
    n //=m
print(res%m)
0