結果

問題 No.657 テトラナッチ数列 Easy
ユーザー kwnwsdnckwnwsdnc
提出日時 2018-03-06 16:47:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 264 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 11,848 KB
実行使用メモリ 17,960 KB
最終ジャッジ日時 2023-10-19 13:38:50
合計ジャッジ時間 11,207 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,056 KB
testcase_01 AC 29 ms
10,056 KB
testcase_02 AC 29 ms
10,056 KB
testcase_03 AC 29 ms
10,056 KB
testcase_04 AC 716 ms
17,328 KB
testcase_05 AC 54 ms
10,428 KB
testcase_06 AC 30 ms
10,056 KB
testcase_07 AC 30 ms
10,056 KB
testcase_08 AC 891 ms
17,960 KB
testcase_09 AC 294 ms
10,676 KB
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
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])%17)
    else:
        T.append((2*T[i+3]-T[i-1])%17)
    i+=1
    

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

0