結果
問題 |
No.657 テトラナッチ数列 Easy
|
ユーザー |
![]() |
提出日時 | 2018-03-05 11:16:15 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 332 bytes |
コンパイル時間 | 81 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 94,128 KB |
最終ジャッジ日時 | 2024-07-19 08:35:59 |
合計ジャッジ時間 | 7,773 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 TLE * 1 |
ソースコード
cash = {1: 0, 2: 0, 3: 0, 4: 1} def t(n: int) -> int: if n in cash: return cash[n] a, b, c, d = 1, 0, 0, 0 # n-1, ..., n-4 for i in range(5, n + 1): a, b, c, d = (a + b + c + d) % 17, a, b, c cash[i] = a return a Q = int(input()) for _ in range(Q): nq = int(input()) print(t(nq))