結果
| 問題 | No.657 テトラナッチ数列 Easy |
| コンテスト | |
| ユーザー |
zbxah
|
| 提出日時 | 2018-03-05 11:26:07 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 322 ms / 2,000 ms |
| + 525µs | |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 312 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 98,824 KB |
| 最終ジャッジ日時 | 2026-08-18 09:01:36 |
| 合計ジャッジ時間 | 4,771 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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