結果

問題 No.658 テトラナッチ数列 Hard
ユーザー toyuzukotoyuzuko
提出日時 2020-07-22 22:25:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 71 ms / 2,000 ms
コード長 218 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,708 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-09-04 21:35:03
合計ジャッジ時間 1,330 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,900 KB
testcase_01 AC 20 ms
7,896 KB
testcase_02 AC 18 ms
7,920 KB
testcase_03 AC 18 ms
7,836 KB
testcase_04 AC 70 ms
7,832 KB
testcase_05 AC 71 ms
7,784 KB
testcase_06 AC 69 ms
7,896 KB
testcase_07 AC 69 ms
7,828 KB
testcase_08 AC 69 ms
7,892 KB
testcase_09 AC 71 ms
7,804 KB
testcase_10 AC 71 ms
7,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
T = [0 for _ in range(4912)]
T[3] = 1

for i in range(4, 4912):
    T[i] = T[i - 1] + T[i - 2] + T[i - 3] + T[i - 4]
    T[i] %= 17

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