結果

問題 No.2269 eN!の整数部分の下1桁
ユーザー 👑 p-adicp-adic
提出日時 2023-04-08 16:31:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 271 ms / 2,000 ms
コード長 158 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 76,556 KB
最終ジャッジ日時 2024-04-14 13:35:12
合計ジャッジ時間 3,434 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,004 KB
testcase_01 AC 40 ms
52,068 KB
testcase_02 AC 38 ms
53,556 KB
testcase_03 AC 37 ms
52,484 KB
testcase_04 AC 37 ms
53,008 KB
testcase_05 AC 37 ms
52,568 KB
testcase_06 AC 37 ms
53,888 KB
testcase_07 AC 38 ms
51,876 KB
testcase_08 AC 36 ms
52,896 KB
testcase_09 AC 37 ms
52,268 KB
testcase_10 AC 36 ms
52,764 KB
testcase_11 AC 37 ms
52,408 KB
testcase_12 AC 37 ms
53,740 KB
testcase_13 AC 36 ms
51,816 KB
testcase_14 AC 38 ms
52,536 KB
testcase_15 AC 39 ms
53,360 KB
testcase_16 AC 57 ms
66,852 KB
testcase_17 AC 76 ms
73,080 KB
testcase_18 AC 257 ms
76,168 KB
testcase_19 AC 257 ms
76,012 KB
testcase_20 AC 261 ms
76,556 KB
testcase_21 AC 271 ms
76,332 KB
testcase_22 AC 254 ms
76,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for t in range(int(input())):
	N=int(input())
	if N==0:print(2)
	else:
		a=p=1
		for i in range(N,max(0,N-4),-1):
			p*=i
			p%=10
			a+=p
			a%=10
		print(a)
0