結果

問題 No.657 テトラナッチ数列 Easy
ユーザー ttrttr
提出日時 2020-02-15 20:50:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 679 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-04-16 03:18:05
合計ジャッジ時間 11,334 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 549 ms
18,236 KB
testcase_01 AC 559 ms
18,344 KB
testcase_02 AC 560 ms
18,224 KB
testcase_03 AC 581 ms
18,336 KB
testcase_04 AC 584 ms
18,440 KB
testcase_05 AC 578 ms
18,564 KB
testcase_06 AC 549 ms
18,336 KB
testcase_07 AC 548 ms
18,440 KB
testcase_08 AC 571 ms
18,300 KB
testcase_09 AC 622 ms
19,016 KB
testcase_10 AC 598 ms
19,040 KB
testcase_11 AC 598 ms
18,800 KB
testcase_12 AC 600 ms
19,016 KB
testcase_13 AC 596 ms
18,864 KB
testcase_14 AC 598 ms
19,012 KB
testcase_15 AC 679 ms
19,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
L = [int(input()) for _ in range(Q)]

N = 10**6 + 1
T = [0]*N
T[4] = 1
for i in range(5, N):
    T[i] = T[i-1] + T[i-2] + T[i-3] + T[i-4]
    T[i] %= 17

for q in L:
    print(T[q])
0