結果

問題 No.657 テトラナッチ数列 Easy
ユーザー yakeshibayakeshiba
提出日時 2020-11-01 02:33:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 195 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 86,932 KB
実行使用メモリ 85,320 KB
最終ジャッジ日時 2023-09-29 11:05:47
合計ジャッジ時間 3,793 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
83,596 KB
testcase_01 AC 86 ms
83,476 KB
testcase_02 AC 88 ms
83,468 KB
testcase_03 AC 90 ms
83,348 KB
testcase_04 AC 85 ms
83,560 KB
testcase_05 AC 135 ms
84,976 KB
testcase_06 AC 85 ms
83,544 KB
testcase_07 AC 86 ms
83,476 KB
testcase_08 AC 84 ms
83,268 KB
testcase_09 AC 135 ms
84,980 KB
testcase_10 AC 137 ms
84,836 KB
testcase_11 AC 136 ms
85,284 KB
testcase_12 AC 135 ms
85,040 KB
testcase_13 AC 135 ms
85,320 KB
testcase_14 AC 139 ms
84,984 KB
testcase_15 AC 138 ms
85,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 17

q = int(input())

dp = [0]*(10**6+1)
dp[4] = 1
for i in range(5,10**6+1):
    dp[i] = (dp[i-1]+dp[i-2]+dp[i-3]+dp[i-4])%mod
    
for _ in range(q):
    n = int(input())
    print(dp[n])
0