結果

問題 No.500 階乗電卓
ユーザー kohei2019kohei2019
提出日時 2022-01-31 23:30:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 234 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,264 KB
実行使用メモリ 71,636 KB
最終ジャッジ日時 2023-09-02 02:26:37
合計ジャッジ時間 2,880 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,404 KB
testcase_01 AC 68 ms
71,388 KB
testcase_02 AC 68 ms
71,420 KB
testcase_03 AC 69 ms
71,284 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 69 ms
71,540 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 68 ms
71,316 KB
testcase_12 AC 68 ms
71,400 KB
testcase_13 AC 67 ms
71,412 KB
testcase_14 AC 69 ms
71,260 KB
testcase_15 AC 68 ms
71,300 KB
testcase_16 AC 68 ms
71,304 KB
testcase_17 AC 68 ms
71,312 KB
testcase_18 AC 68 ms
71,488 KB
testcase_19 AC 69 ms
71,404 KB
testcase_20 AC 69 ms
71,372 KB
testcase_21 AC 68 ms
71,320 KB
testcase_22 AC 67 ms
71,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
mod = 1000000000000
ans = 1
f = False
for i in range(1,N+1):
    ans *= i
    if f==False and ans //mod >= 1:
        f = True
    ans %= mod
    if ans == 0:
        break
l = str(ans)
print('0'*(12-len(l))+str(ans))
0