結果
| 問題 |
No.2577 Simple Permutation Guess
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-05 17:29:01 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 640 bytes |
| コンパイル時間 | 397 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 27,976 KB |
| 平均クエリ数 | 0.91 |
| 最終ジャッジ日時 | 2024-09-27 00:18:16 |
| 合計ジャッジ時間 | 11,073 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 111 |
ソースコード
from sortedcontainers import SortedList
N = int(input())
ans = []
ok = set()
for i in range(N):
s = SortedList()
for j in range(1, N + 1):
if j in ok:
continue
s.add(j)
l = 0
r = len(s)
while r - l > 1:
mid = (l + r) // 2
k = s[mid]
Q = ans + [k]
for m in range(1, N + 1):
if m in s and m != k:
Q.append(m)
print("?", *Q, flush=True)
ret = int(input())
if ret == 1:
l = mid
else:
r = mid
ans.append(s[l])
ok.add(s[l])
s.discard(s[l])
print("!", *ans, flush=True)