結果

問題 No.657 テトラナッチ数列 Easy
ユーザー June3141June3141
提出日時 2018-10-14 22:06:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 238 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-04-20 20:20:16
合計ジャッジ時間 4,380 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 498 ms
18,048 KB
testcase_05 RE -
testcase_06 AC 35 ms
10,880 KB
testcase_07 AC 33 ms
10,624 KB
testcase_08 AC 542 ms
18,560 KB
testcase_09 AC 65 ms
11,136 KB
testcase_10 AC 69 ms
11,392 KB
testcase_11 AC 69 ms
11,392 KB
testcase_12 AC 115 ms
12,032 KB
testcase_13 AC 576 ms
19,072 KB
testcase_14 AC 560 ms
19,200 KB
testcase_15 AC 562 ms
19,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

n_max = max(n)
T = [0 for i in range(n_max)]
T[3] = 1

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

for i in range(Q):
    print(T[n[i] - 1])
0