結果

問題 No.500 階乗電卓
ユーザー s_shohei
提出日時 2020-04-23 12:22:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,740 KB
最終ジャッジ日時 2024-10-13 10:14:24
合計ジャッジ時間 1,830 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

if n>100:
    print("000000000000")
    exit()

def fact(n,mod=10**12):
    powlist=[0]*(n+1)
    powlist[0]=1
    powlist[1]=1
    for i in range(2,n+1):
        powlist[i]=powlist[i-1]*i%(mod)
    return powlist[-1]

ans = fact(n)
if ans==0:
    print("000000000000")
else:
    print(ans)
0