結果

問題 No.657 テトラナッチ数列 Easy
ユーザー terrafarmterrafarm
提出日時 2020-06-21 08:38:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 201 bytes
コンパイル時間 2,038 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 85,848 KB
最終ジャッジ日時 2023-09-16 18:08:50
合計ジャッジ時間 3,576 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
83,368 KB
testcase_01 AC 81 ms
83,532 KB
testcase_02 AC 82 ms
83,564 KB
testcase_03 AC 85 ms
83,588 KB
testcase_04 AC 83 ms
83,624 KB
testcase_05 AC 118 ms
85,604 KB
testcase_06 AC 82 ms
83,500 KB
testcase_07 AC 82 ms
83,540 KB
testcase_08 AC 83 ms
83,624 KB
testcase_09 AC 113 ms
85,712 KB
testcase_10 AC 112 ms
85,728 KB
testcase_11 AC 117 ms
85,848 KB
testcase_12 AC 119 ms
85,680 KB
testcase_13 AC 114 ms
85,528 KB
testcase_14 AC 114 ms
85,528 KB
testcase_15 AC 114 ms
85,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
N = [int(input()) for _ in range(Q)]
seq = [0] * 1001000
seq[4] = 1
for i in range(5,1000500):
    seq[i] = (seq[i-1] + seq[i-2] + seq[i-3] + seq[i-4])%17
for n in N:
    print(seq[n])
0