結果

問題 No.657 テトラナッチ数列 Easy
ユーザー ああいいああいい
提出日時 2021-12-06 15:05:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 540 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 10,668 KB
実行使用メモリ 15,644 KB
最終ジャッジ日時 2023-09-21 15:29:57
合計ジャッジ時間 9,888 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 492 ms
15,644 KB
testcase_01 AC 485 ms
15,496 KB
testcase_02 AC 497 ms
15,644 KB
testcase_03 AC 490 ms
15,532 KB
testcase_04 AC 487 ms
15,528 KB
testcase_05 AC 538 ms
15,528 KB
testcase_06 AC 494 ms
15,640 KB
testcase_07 AC 490 ms
15,576 KB
testcase_08 AC 500 ms
15,568 KB
testcase_09 AC 540 ms
15,604 KB
testcase_10 AC 536 ms
15,492 KB
testcase_11 AC 538 ms
15,636 KB
testcase_12 AC 534 ms
15,572 KB
testcase_13 AC 538 ms
15,584 KB
testcase_14 AC 534 ms
15,536 KB
testcase_15 AC 534 ms
15,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


T = [0] * (10 ** 6 + 1)
T[4] = 1
for i in range(5,10 ** 6 + 1):
    T[i] = T[i-1] + T[i-2] + T[i-3] + T[i-4]
    T[i] %= 17
Q = int(input())
for _ in range(Q):
    print(T[int(input())])
0