結果

問題 No.657 テトラナッチ数列 Easy
ユーザー YutaroYamanakaYutaroYamanaka
提出日時 2018-03-08 23:59:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 234 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-04-15 12:22:38
合計ジャッジ時間 4,043 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 32 ms
10,752 KB
testcase_04 AC 468 ms
17,920 KB
testcase_05 RE -
testcase_06 AC 32 ms
10,752 KB
testcase_07 AC 34 ms
10,752 KB
testcase_08 AC 508 ms
18,564 KB
testcase_09 AC 62 ms
11,264 KB
testcase_10 AC 67 ms
11,520 KB
testcase_11 AC 67 ms
11,520 KB
testcase_12 AC 113 ms
12,032 KB
testcase_13 AC 552 ms
19,072 KB
testcase_14 AC 525 ms
19,200 KB
testcase_15 AC 536 ms
19,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q_num = int(input())
query = [ int(input()) for _ in range(Q_num) ]
q_max = max(query)

Ti = [0] * (q_max)
Ti[3] = 1
for i in range(4, q_max):
    Ti[i] = (Ti[i-4] + Ti[i-3] + Ti[i-2] + Ti[i-1])%17

for n in query:
    print(Ti[n-1])
0