結果

問題 No.2269 eN!の整数部分の下1桁
ユーザー lam6er
提出日時 2025-03-20 20:48:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 101 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 94,920 KB
最終ジャッジ日時 2025-03-20 20:49:02
合計ジャッジ時間 2,299 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# Precomputed answers for N from 1 to 10 (index 0 to 9)
answers = [2, 5, 6, 5, 6, 7, 0, 1, 0, 1]

def main():
    input = sys.stdin.read().split()
    T = int(input[0])
    for i in range(1, T+1):
        N = int(input[i])
        if N == 0:
            print(2)
        else:
            idx = (N - 1) % 10
            print(answers[idx])

if __name__ == "__main__":
    main()
0