結果

問題 No.657 テトラナッチ数列 Easy
ユーザー kwnwsdnckwnwsdnc
提出日時 2018-03-06 16:36:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 276 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,920 KB
実行使用メモリ 18,028 KB
最終ジャッジ日時 2023-10-19 12:53:16
合計ジャッジ時間 10,997 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
17,132 KB
testcase_01 AC 34 ms
10,120 KB
testcase_02 AC 31 ms
10,120 KB
testcase_03 AC 32 ms
10,120 KB
testcase_04 AC 720 ms
17,396 KB
testcase_05 AC 58 ms
10,488 KB
testcase_06 AC 31 ms
10,120 KB
testcase_07 AC 30 ms
10,120 KB
testcase_08 AC 894 ms
18,028 KB
testcase_09 AC 296 ms
10,736 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
    
j=0
while j<Q:
    print(T[N[j]])
    j+=1
0