結果

問題 No.657 テトラナッチ数列 Easy
ユーザー ntudantuda
提出日時 2022-10-31 18:56:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 1,746 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 85,384 KB
最終ジャッジ日時 2023-09-22 15:47:30
合計ジャッジ時間 4,606 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
83,552 KB
testcase_01 AC 87 ms
83,576 KB
testcase_02 AC 84 ms
83,576 KB
testcase_03 AC 86 ms
83,640 KB
testcase_04 AC 86 ms
83,612 KB
testcase_05 AC 155 ms
85,192 KB
testcase_06 AC 83 ms
83,860 KB
testcase_07 AC 84 ms
83,712 KB
testcase_08 AC 86 ms
83,548 KB
testcase_09 AC 135 ms
85,136 KB
testcase_10 AC 138 ms
85,036 KB
testcase_11 AC 136 ms
85,384 KB
testcase_12 AC 137 ms
85,216 KB
testcase_13 AC 136 ms
85,172 KB
testcase_14 AC 137 ms
85,136 KB
testcase_15 AC 135 ms
84,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
N = 10 ** 6
T = [0] * (N + 1)
T[4] = 1
tmp = sum(T[1:5])
for i in range(5, N+1):
    T[i] = tmp
    tmp += T[i] - T[i-4]
    tmp %= 17
for _ in range(Q):
    print(T[int(input())])
0