結果

問題 No.658 テトラナッチ数列 Hard
ユーザー June3141June3141
提出日時 2018-10-15 02:29:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 305 bytes
コンパイル時間 212 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 565,272 KB
最終ジャッジ日時 2024-04-20 20:22:29
合計ジャッジ時間 4,274 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,880 KB
testcase_01 AC 31 ms
10,624 KB
testcase_02 MLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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

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

if n_max >= 4:
    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