結果

問題 No.3347 Guess The Array
コンテスト
ユーザー 👑 loop0919
提出日時 2025-11-13 21:57:00
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 489 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 81,932 KB
実行使用メモリ 96,408 KB
平均クエリ数 3820.96
最終ジャッジ日時 2025-11-13 21:57:24
合計ジャッジ時間 23,919 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15 RE * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())


def question(A):
    print("?", len(A), *A)
    return input() == "Yes"


length = [0] * (N + 1)

for i in range(1, N + 1):
    for j in range(1, N + 1):
        if question([i] * j):
            length[i] += 1
        else:
            break

ans = [1] * length[1]

for i in range(2, N + 1):
    j = 0
    while j <= len(ans) and ans.count(i) < length[i]:
        ans.insert(j, i)

        if not question(ans):
            ans.pop(j)

        j += 1

print("!", *ans)
0