結果

問題 No.657 テトラナッチ数列 Easy
ユーザー RyutoRyuto
提出日時 2018-03-19 12:35:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 300 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 519 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 146,664 KB
最終ジャッジ日時 2023-08-30 03:34:28
合計ジャッジ時間 3,959 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,276 KB
testcase_01 AC 77 ms
71,168 KB
testcase_02 AC 76 ms
71,240 KB
testcase_03 AC 74 ms
71,264 KB
testcase_04 AC 251 ms
137,200 KB
testcase_05 AC 111 ms
77,472 KB
testcase_06 AC 74 ms
71,348 KB
testcase_07 AC 76 ms
71,280 KB
testcase_08 AC 259 ms
145,340 KB
testcase_09 AC 115 ms
77,680 KB
testcase_10 AC 127 ms
77,820 KB
testcase_11 AC 121 ms
77,796 KB
testcase_12 AC 147 ms
81,312 KB
testcase_13 AC 298 ms
145,996 KB
testcase_14 AC 300 ms
146,600 KB
testcase_15 AC 294 ms
146,664 KB
権限があれば一括ダウンロードができます

ソースコード

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