結果

問題 No.657 テトラナッチ数列 Easy
ユーザー neko_the_shadowneko_the_shadow
提出日時 2018-03-21 22:25:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 448 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 10,732 KB
実行使用メモリ 16,708 KB
最終ジャッジ日時 2023-09-07 01:05:12
合計ジャッジ時間 4,150 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 15 ms
7,868 KB
testcase_02 AC 16 ms
7,876 KB
testcase_03 AC 15 ms
7,908 KB
testcase_04 AC 393 ms
15,240 KB
testcase_05 AC 37 ms
8,708 KB
testcase_06 AC 16 ms
8,012 KB
testcase_07 AC 16 ms
7,868 KB
testcase_08 AC 420 ms
15,976 KB
testcase_09 AC 40 ms
8,824 KB
testcase_10 AC 43 ms
8,916 KB
testcase_11 AC 44 ms
8,884 KB
testcase_12 AC 81 ms
9,736 KB
testcase_13 AC 448 ms
16,708 KB
testcase_14 AC 446 ms
16,688 KB
testcase_15 AC 440 ms
16,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

if __name__ == '__main__':
	q = int(input())
	ns = tuple(int(input()) for _ in range(q))

	ts = [0, 0, 0, 0, 1]
	for i in range(5, max(ns) + 1):
		ts.append(sum(ts[-1:-5:-1]) % 17)

	for n in ns:
		print(ts[n])
0