結果
| 問題 | No.3811 Mid Filter |
| コンテスト | |
| ユーザー |
sepa38
|
| 提出日時 | 2026-10-23 13:36:48 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 371 ms / 2,000 ms |
| + 999µs | |
| コード長 | 1,110 bytes |
| 記録 | |
| コンパイル時間 | 119 ms |
| コンパイル使用メモリ | 64,296 KB |
| 実行使用メモリ | 64,988 KB |
| 平均クエリ数 | 829.97 |
| 最終ジャッジ日時 | 2026-11-20 20:52:56 |
| 合計ジャッジ時間 | 7,776 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
n, k = map(int, input().split())
if k == 1:
cnd = [1]
for i in range(2, n+1):
cnd.append(i)
print("?", *cnd, flush = True)
r = int(input())
cnd = [r]
print("!", *cnd, flush = True)
exit()
d = dict()
rol = [i + 1 for i in range(2*k+1)]
for v in rol:
tmp = rol[:]
tmp.remove(v)
print("?", *tmp, flush = True)
r = int(input())
if r in d:
d[r].append(v)
else:
d[r] = [v]
now = rol[:]
cnd = []
for x in d.keys():
if len(d[x]) == k:
u = x
cnd = d[u][:]
else:
l = x
# print(d)
for v in d[l]:
if v != u:
now.remove(v)
if len(now) == 2*k - 1:
break
for i in range(2*k+2, n+1):
now.append(i)
print("?", *now, flush = True)
r = int(input())
# print(now, cnd, r)
if r != l:
now.remove(u)
cnd.remove(l)
# now.append(i)
cnd.append(i)
u = l
l = r
else:
now.remove(i)
# print(now, cnd, u, l, i)
# print("=" * 30)
print("!", *cnd, flush = True)
"""
4,1,6,2,5,3
3,1,2
"""
sepa38