結果

問題 No.500 階乗電卓
ユーザー fiord
提出日時 2017-04-07 23:26:01
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-16 03:05:47
合計ジャッジ時間 985 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n=input()
if n>1000:
	print("000000000000")
else:
	mod=1000000000000
	i=2
	ret=1
	used=False
	while i<=n:
		ret*=i
		if(ret>=mod):
			ret%=mod
			used=True
		i+=1
	i=0
	if used:
		while mod/10>ret:
			i+=1
			mod/=10
	print("0"*i+str(ret))
0