結果

問題 No.2269 eN!の整数部分の下1桁
コンテスト
ユーザー fiblonaria
提出日時 2023-04-14 22:04:08
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 326 ms / 2,000 ms
コード長 233 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 191 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 81,280 KB
最終ジャッジ日時 2026-04-26 14:41:55
合計ジャッジ時間 3,794 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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