結果

問題 No.657 テトラナッチ数列 Easy
ユーザー lloyzlloyz
提出日時 2022-07-25 21:04:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 542 ms / 2,000 ms
コード長 206 bytes
コンパイル時間 655 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 16,104 KB
最終ジャッジ日時 2023-09-22 07:07:50
合計ジャッジ時間 10,427 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 486 ms
15,960 KB
testcase_01 AC 479 ms
15,968 KB
testcase_02 AC 479 ms
16,092 KB
testcase_03 AC 490 ms
16,012 KB
testcase_04 AC 482 ms
15,912 KB
testcase_05 AC 540 ms
16,008 KB
testcase_06 AC 492 ms
16,096 KB
testcase_07 AC 480 ms
16,100 KB
testcase_08 AC 478 ms
15,980 KB
testcase_09 AC 535 ms
16,104 KB
testcase_10 AC 542 ms
15,728 KB
testcase_11 AC 529 ms
15,792 KB
testcase_12 AC 532 ms
15,880 KB
testcase_13 AC 539 ms
15,968 KB
testcase_14 AC 536 ms
16,008 KB
testcase_15 AC 528 ms
15,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 17
T = [0 for _ in range(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]) % mod

q = int(input())
for _ in range(q):
    print(T[int(input())])
0