結果
| 問題 | No.500 階乗電卓 |
| コンテスト | |
| ユーザー |
mnr
|
| 提出日時 | 2020-02-29 08:00:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 288 bytes |
| 記録 | |
| コンパイル時間 | 76 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,136 KB |
| 最終ジャッジ日時 | 2024-10-13 19:49:28 |
| 合計ジャッジ時間 | 1,420 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 WA * 4 RE * 9 |
ソースコード
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)
mnr