結果

問題 No.3347 Guess The Array
コンテスト
ユーザー 回転
提出日時 2025-11-14 03:10:43
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,228 KB
実行使用メモリ 94,036 KB
平均クエリ数 907.98
最終ジャッジ日時 2025-11-14 03:10:54
合計ジャッジ時間 10,245 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
N = int(input())

memo = defaultdict(str)
ans = []
for i in range(1,N+1):
    pos = []
    for c in range(1,N+1):
        print("?",c,*[i]*c)
        yn = input()
        if(yn == "No"):break
        
        ok,ng = 0,len(ans)+1
        while(ng - ok > 1):
            mid = (ok+ng)//2
            now = ans[:mid] + [i]*c
            print("?",len(now),*now)
            if(input() == "Yes"):
                ok = mid
            else:
                ng = mid
    
    for p in pos:
        ans.insert(ok,i)

print("!",*ans)
0