結果

問題 No.657 テトラナッチ数列 Easy
ユーザー toyuzukotoyuzuko
提出日時 2020-07-22 22:16:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 577 ms / 2,000 ms
コード長 211 bytes
コンパイル時間 711 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 16,184 KB
最終ジャッジ日時 2023-09-04 21:14:49
合計ジャッジ時間 10,888 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 519 ms
15,992 KB
testcase_01 AC 526 ms
16,112 KB
testcase_02 AC 518 ms
15,960 KB
testcase_03 AC 521 ms
16,092 KB
testcase_04 AC 518 ms
15,988 KB
testcase_05 AC 573 ms
15,976 KB
testcase_06 AC 524 ms
16,048 KB
testcase_07 AC 516 ms
15,988 KB
testcase_08 AC 516 ms
16,044 KB
testcase_09 AC 561 ms
16,112 KB
testcase_10 AC 566 ms
16,116 KB
testcase_11 AC 568 ms
16,024 KB
testcase_12 AC 572 ms
16,104 KB
testcase_13 AC 568 ms
16,088 KB
testcase_14 AC 567 ms
16,184 KB
testcase_15 AC 577 ms
16,092 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
T = [0 for _ in range(10**6)]
T[3] = 1

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

for _ in range(Q):
    n = int(input())
    print(T[n - 1])
0