結果

問題 No.657 テトラナッチ数列 Easy
ユーザー MIKI TakushiMIKI Takushi
提出日時 2019-01-02 17:51:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 496 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 19,200 KB
最終ジャッジ日時 2024-05-01 05:33:30
合計ジャッジ時間 8,934 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 459 ms
18,464 KB
testcase_01 AC 471 ms
18,516 KB
testcase_02 AC 431 ms
18,476 KB
testcase_03 AC 445 ms
18,488 KB
testcase_04 AC 448 ms
18,472 KB
testcase_05 AC 496 ms
18,796 KB
testcase_06 AC 456 ms
18,492 KB
testcase_07 AC 445 ms
18,536 KB
testcase_08 AC 450 ms
18,468 KB
testcase_09 AC 478 ms
19,044 KB
testcase_10 AC 493 ms
19,160 KB
testcase_11 AC 467 ms
19,200 KB
testcase_12 AC 481 ms
19,116 KB
testcase_13 AC 459 ms
19,104 KB
testcase_14 AC 464 ms
19,096 KB
testcase_15 AC 464 ms
19,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

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

q = int(input())
ql = [int(input()) for _ in range(q)]

for q in ql:
    print(T[q])
0