結果

問題 No.500 階乗電卓
ユーザー brthyyjpbrthyyjp
提出日時 2020-09-04 11:32:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 262 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 82,172 KB
実行使用メモリ 53,256 KB
最終ジャッジ日時 2024-11-25 05:39:45
合計ジャッジ時間 1,802 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n >= 60:
    print('0'*12)
elif n <= 14:
    ans = 1
    for i in range(1, n+1):
        ans *= i
    print(ans)
else:
    ans = 1
    for i in range(1, n+1):
        ans *= i
        ans %= 10**12
    ans = str(ans)
    print(ans.zfill(12))
0