結果

問題 No.657 テトラナッチ数列 Easy
ユーザー kwnwsdnckwnwsdnc
提出日時 2018-03-06 16:51:35
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 257 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 817,720 KB
最終ジャッジ日時 2023-10-19 14:21:24
合計ジャッジ時間 2,601 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

Q=int(input())
N=[]
for _ in range (Q):
    N.append(int(input()))


T=[0,0,0,0,1]

i=1
while i<max(N):
    if i<=4:    
        T.append(T[i]+T[i+1]+T[i+2]+T[i+3])
    else:
        T.append(2*T[i+3]-T[i-1])
    i+=1
    

for n in N: 
    print(T[n]%17)

0