結果

問題 No.500 階乗電卓
ユーザー mnrmnr
提出日時 2020-02-29 08:00:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 288 bytes
コンパイル時間 123 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-04-21 21:27:08
合計ジャッジ時間 1,766 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 31 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 34 ms
10,752 KB
testcase_11 AC 30 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 29 ms
10,752 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorial(n):
    if n == 1:
        return 1
    else:
        return n * factorial(n-1)
        
N = int(input())
Nf = factorial(N)
if Nf >= 10**12:
    Nf_l = list(str(Nf))
    s = ""
    for i in range(-12,0):
        s += Nf_l[i]
    print(int(s))
elif Nf < 10**12:
    print(Nf)
0