結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
zbxah
|
| 提出日時 | 2018-03-05 11:26:07 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 313 ms / 2,000 ms |
| コード長 | 343 bytes |
| コンパイル時間 | 156 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 94,492 KB |
| 最終ジャッジ日時 | 2024-07-19 08:52:50 |
| 合計ジャッジ時間 | 2,719 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
tetranacci = {1: 0, 2: 0, 3: 0, 4: 1}
def t(n: int):
a, b, c, d = tetranacci[4], tetranacci[3], tetranacci[2], tetranacci[1]
for i in range(5, n + 1):
a, b, c, d = (a + b + c + d) % 17, a, b, c
tetranacci[i] = a
Q = int(input())
xs = [int(input()) for _ in range(Q)]
t(max(xs))
for x in xs:
print(tetranacci[x])
zbxah