結果

問題 No.2269 eN!の整数部分の下1桁
ユーザー fiblonariafiblonaria
提出日時 2023-04-14 22:04:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 167 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,924 KB
最終ジャッジ日時 2024-04-18 19:28:42
合計ジャッジ時間 3,623 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,456 KB
testcase_01 AC 44 ms
51,456 KB
testcase_02 AC 43 ms
51,456 KB
testcase_03 AC 40 ms
51,328 KB
testcase_04 AC 41 ms
51,584 KB
testcase_05 AC 41 ms
51,584 KB
testcase_06 AC 42 ms
51,712 KB
testcase_07 AC 41 ms
51,456 KB
testcase_08 AC 40 ms
51,840 KB
testcase_09 AC 40 ms
51,712 KB
testcase_10 AC 40 ms
51,712 KB
testcase_11 AC 40 ms
51,328 KB
testcase_12 AC 40 ms
51,712 KB
testcase_13 AC 41 ms
51,584 KB
testcase_14 AC 40 ms
51,712 KB
testcase_15 AC 43 ms
52,352 KB
testcase_16 AC 78 ms
68,992 KB
testcase_17 AC 117 ms
76,032 KB
testcase_18 AC 296 ms
76,160 KB
testcase_19 AC 304 ms
76,924 KB
testcase_20 AC 279 ms
76,172 KB
testcase_21 AC 293 ms
76,248 KB
testcase_22 AC 283 ms
75,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
T = int(input())
for i in range(T):
	N = int(input())
	if N == 0:
		print(2)
		continue
	temp = 1
	ans = 0
	for i in range(N, -1, -1):
		ans = (ans + temp) % 10
		temp = (temp * i) % 10
		if temp == 0:
			break
	print(ans)
0