結果
問題 |
No.500 階乗電卓
|
ユーザー |
|
提出日時 | 2023-05-22 21:27:04 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 244 bytes |
コンパイル時間 | 155 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-22 15:40:30 |
合計ジャッジ時間 | 1,729 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
def func(n): if n==0: return 1 else: return n*func(n-1) n=int(input()) if n>=50: print("000000000000") else: if len(str(func(n))) < 12: print(func(n)) else: print(f"{'0' * (12 - len(str(func(n) % (10**12))))}{func(n) % (10**12)}")