結果
| 問題 |
No.3347 Guess The Array
|
| コンテスト | |
| ユーザー |
とりゐ
|
| 提出日時 | 2025-11-13 21:45:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 716 ms / 2,000 ms |
| コード長 | 606 bytes |
| コンパイル時間 | 287 ms |
| コンパイル使用メモリ | 82,716 KB |
| 実行使用メモリ | 95,900 KB |
| 平均クエリ数 | 4292.02 |
| 最終ジャッジ日時 | 2025-11-13 21:45:37 |
| 合計ジャッジ時間 | 28,663 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 46 |
ソースコード
def ask(arr):
if len(arr) > n:
return False
print("?", len(arr), *arr, flush=True)
s = input()
return s == "Yes"
n = int(input())
ans = []
for v in range(1, n + 1):
cnt = 0
while True:
if not ask([v] * (cnt + 1)):
break
cnt += 1
for c in range(1, cnt + 1):
ng, ok = len(ans) + 1, 0
while ng - ok > 1:
mid = (ok + ng) // 2
res = ans[:mid] + [v] * c
if ask(res):
ok = mid
else:
ng = mid
ans = ans[:ok] + [v] + ans[ok:]
print("!", *ans)
とりゐ