結果

問題 No.657 テトラナッチ数列 Easy
ユーザー neterukunneterukun
提出日時 2019-06-08 17:36:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 614 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 133 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-04-15 19:57:26
合計ジャッジ時間 10,302 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 593 ms
18,688 KB
testcase_01 AC 531 ms
18,560 KB
testcase_02 AC 560 ms
18,560 KB
testcase_03 AC 562 ms
18,688 KB
testcase_04 AC 529 ms
18,560 KB
testcase_05 AC 614 ms
18,816 KB
testcase_06 AC 556 ms
18,560 KB
testcase_07 AC 550 ms
18,560 KB
testcase_08 AC 546 ms
18,560 KB
testcase_09 AC 587 ms
19,072 KB
testcase_10 AC 553 ms
19,200 KB
testcase_11 AC 576 ms
19,072 KB
testcase_12 AC 560 ms
19,072 KB
testcase_13 AC 587 ms
19,072 KB
testcase_14 AC 574 ms
19,200 KB
testcase_15 AC 560 ms
19,200 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

q = int(input())
n = [int(input()) for i in range(q)]

t = [0]*1000001
t[4] = 1
for i in range(5,1000001):
    t[i] = t[i-1] + t[i-2] + t[i-3] + t[i-4]
    t[i] %= 17

for i in range(q):
    print(t[n[i]])
0