結果
問題 |
No.2577 Simple Permutation Guess
|
ユーザー |
|
提出日時 | 2023-12-05 20:58:55 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 759 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 93,800 KB |
平均クエリ数 | 251.95 |
最終ジャッジ日時 | 2024-09-27 00:24:15 |
合計ジャッジ時間 | 18,980 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 110 RE * 1 |
ソースコード
N = int(input()) seen = set() ans = [] for i in range(N): s = [] for j in range(1, N + 1): if j in seen: continue s.append(j) l = 0 r = len(s) while r - l > 1: mid = (l + r) // 2 k = s[mid] Q = ans + [k] for m in s: if m != k: Q.append(m) print("?", *Q, flush=True) ret = int(input()) if ret == 1: l = mid else: r = mid ans.append(s[l]) seen.add(s[l]) print("!", *ans, flush=True)