結果

問題 No.658 テトラナッチ数列 Hard
ユーザー hedwig100hedwig100
提出日時 2020-05-12 21:57:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 419 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 10,544 KB
実行使用メモリ 9,184 KB
最終ジャッジ日時 2023-10-12 00:17:05
合計ジャッジ時間 1,483 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,928 KB
testcase_01 AC 17 ms
7,936 KB
testcase_02 AC 18 ms
7,848 KB
testcase_03 AC 18 ms
8,064 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(100000000)
MOD = 17
INF = 10 ** 15
from bisect import bisect_left,bisect_right

def main():  
    Q = int(input())
    Ns = [int(input()) for _ in range(Q)]
    tetora = [0] * 5000
    tetora[4] = 1
    for i in range(5,5000):
        tetora[i] = sum(tetora[i - 4:i])%MOD
    Ns = [n%4912 for n in Ns]
    print(*[tetora[n] for n in Ns],sep = '\n')
if __name__ == '__main__':
    main()
0