結果

問題 No.658 テトラナッチ数列 Hard
ユーザー jensenjensen
提出日時 2021-01-20 10:43:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 214 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,908 KB
最終ジャッジ日時 2023-08-23 13:48:03
合計ジャッジ時間 1,426 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,832 KB
testcase_01 AC 18 ms
7,872 KB
testcase_02 AC 17 ms
7,868 KB
testcase_03 AC 18 ms
7,784 KB
testcase_04 AC 42 ms
8,820 KB
testcase_05 AC 42 ms
8,884 KB
testcase_06 AC 42 ms
8,908 KB
testcase_07 AC 43 ms
8,816 KB
testcase_08 AC 42 ms
8,908 KB
testcase_09 AC 43 ms
8,868 KB
testcase_10 AC 43 ms
8,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=[0,0,0,1]
mod=17
x=0
i=0
for i in range(4,4913):
    t.append((t[i-1]+t[i-2]+t[i-3]+t[i-4])%17)

Q=int(input())
n=[int(input()) for _ in range(Q)]
for q in range(Q):
    print(t[(n[q]-1)%4912])
0