結果

問題 No.657 テトラナッチ数列 Easy
ユーザー takakintakakin
提出日時 2020-05-07 22:54:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 456 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 10,576 KB
実行使用メモリ 16,344 KB
最終ジャッジ日時 2023-09-16 08:10:57
合計ジャッジ時間 8,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 445 ms
15,704 KB
testcase_01 AC 445 ms
15,828 KB
testcase_02 AC 438 ms
15,740 KB
testcase_03 AC 442 ms
15,744 KB
testcase_04 AC 447 ms
15,652 KB
testcase_05 AC 448 ms
16,296 KB
testcase_06 AC 437 ms
15,736 KB
testcase_07 AC 446 ms
15,648 KB
testcase_08 AC 437 ms
15,736 KB
testcase_09 AC 448 ms
16,252 KB
testcase_10 AC 455 ms
16,304 KB
testcase_11 AC 448 ms
16,308 KB
testcase_12 AC 450 ms
16,276 KB
testcase_13 AC 456 ms
16,344 KB
testcase_14 AC 452 ms
16,180 KB
testcase_15 AC 448 ms
16,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
q=int(input())
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])%17
for _ in range(q):
  print(T[int(input())])
0