結果

問題 No.658 テトラナッチ数列 Hard
ユーザー RyutoRyuto
提出日時 2018-03-19 12:37:32
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 346 bytes
コンパイル時間 591 ms
コンパイル使用メモリ 86,824 KB
実行使用メモリ 388,504 KB
最終ジャッジ日時 2023-08-30 03:35:11
合計ジャッジ時間 4,788 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#!/usr/bin/env python

def Tn(n, tlist):
    ans = sum(tlist[n-4:n]) % 17
    return ans

Q = int(input())
inval = []
for i in range(Q):
    inval.append(int(input()))
tlist = [0, 0, 0, 0, 1]
nmax = 4

for n in inval:
    if n > nmax:
        for i in range(nmax+1,n+1):
            tlist.append(Tn(i,tlist))
        nmax = n
    print(tlist[n])
0