結果
問題 | No.2269 eN!の整数部分の下1桁 |
ユーザー | fiblonaria |
提出日時 | 2023-04-14 22:04:08 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 301 ms / 2,000 ms |
コード長 | 233 bytes |
コンパイル時間 | 428 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 76,928 KB |
最終ジャッジ日時 | 2024-10-10 12:50:21 |
合計ジャッジ時間 | 3,964 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
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)