結果

問題 No.657 テトラナッチ数列 Easy
ユーザー RyutoRyuto
提出日時 2018-03-19 12:30:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 246,408 KB
最終ジャッジ日時 2023-08-30 03:34:24
合計ジャッジ時間 6,115 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,848 KB
testcase_01 AC 73 ms
71,092 KB
testcase_02 AC 72 ms
71,184 KB
testcase_03 AC 77 ms
71,216 KB
testcase_04 AC 238 ms
137,036 KB
testcase_05 AC 110 ms
77,696 KB
testcase_06 AC 73 ms
71,360 KB
testcase_07 AC 72 ms
71,100 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
権限があれば一括ダウンロードができます

ソースコード

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))
    print(tlist[n])
0