結果
| 問題 | No.658 テトラナッチ数列 Hard |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-08-05 17:40:11 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 128 ms / 2,000 ms |
| + 582µs | |
| コード長 | 263 bytes |
| 記録 | |
| コンパイル時間 | 292 ms |
| コンパイル使用メモリ | 21,152 KB |
| 実行使用メモリ | 15,740 KB |
| 最終ジャッジ日時 | 2026-08-29 09:05:43 |
| 合計ジャッジ時間 | 3,032 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 |
ソースコード
tt = [0, 0, 0, 1]
while 1:
num = tt[-1] + tt[-2] + tt[-3] + tt[-4]
num %= 17
tt.append(num)
if tt[:4] == tt[-4:]:
break
tt = tt[:-4]
l = len(tt)
q = int(input())
for _ in range(q):
n = int(input())
n %= l
print(tt[n - 1])