結果

問題 No.657 テトラナッチ数列 Easy
ユーザー pochiMasahiropochiMasahiro
提出日時 2018-03-07 01:44:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 233 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 18,500 KB
最終ジャッジ日時 2023-10-22 05:19:24
合計ジャッジ時間 3,790 ms
ジャッジサーバーID
(参考情報)
judge9 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 30 ms
10,028 KB
testcase_04 AC 427 ms
17,088 KB
testcase_05 RE -
testcase_06 AC 30 ms
10,028 KB
testcase_07 AC 29 ms
10,028 KB
testcase_08 AC 455 ms
17,628 KB
testcase_09 AC 55 ms
10,608 KB
testcase_10 AC 59 ms
10,772 KB
testcase_11 AC 60 ms
10,772 KB
testcase_12 AC 98 ms
11,472 KB
testcase_13 AC 479 ms
18,500 KB
testcase_14 AC 479 ms
18,500 KB
testcase_15 AC 482 ms
18,496 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