結果
| 問題 | No.657 テトラナッチ数列 Easy |
| コンテスト | |
| ユーザー |
zbxah
|
| 提出日時 | 2018-03-05 11:26:07 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 231 ms / 2,000 ms |
| + 438µs | |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 51 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 93,932 KB |
| 最終ジャッジ日時 | 2026-10-29 17:36:59 |
| 合計ジャッジ時間 | 4,175 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
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