結果

問題 No.657 テトラナッチ数列 Easy
ユーザー popketlepopketle
提出日時 2020-01-10 12:42:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 665 ms / 2,000 ms
コード長 179 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-05-03 01:47:42
合計ジャッジ時間 11,580 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 595 ms
18,432 KB
testcase_01 AC 599 ms
18,560 KB
testcase_02 AC 595 ms
18,432 KB
testcase_03 AC 591 ms
18,484 KB
testcase_04 AC 618 ms
18,464 KB
testcase_05 AC 665 ms
18,968 KB
testcase_06 AC 590 ms
18,432 KB
testcase_07 AC 604 ms
18,528 KB
testcase_08 AC 606 ms
18,492 KB
testcase_09 AC 634 ms
18,944 KB
testcase_10 AC 628 ms
19,120 KB
testcase_11 AC 616 ms
19,072 KB
testcase_12 AC 639 ms
18,944 KB
testcase_13 AC 631 ms
19,200 KB
testcase_14 AC 614 ms
19,072 KB
testcase_15 AC 625 ms
19,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

q=int(input())
N=[int(input()) for _ in range(q)]

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

for n in N:
    print(T[n-1])
0