結果

問題 No.934 Explosive energy drink
ユーザー face4
提出日時 2019-11-29 22:00:42
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 926 bytes
コンパイル時間 791 ms
コンパイル使用メモリ 75,760 KB
実行使用メモリ 25,476 KB
平均クエリ数 709.54
最終ジャッジ日時 2024-07-16 18:21:28
合計ジャッジ時間 4,851 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main(){
    int n;
    cin >> n;
    set<int> ans;
    int now = n-1;
    while(now >= 1){
        cout << "? " << now+ans.size() << endl << flush;
        for(int i = 1; i <= now; i++){
            if(i-1) cout << " ";
            cout << i;
        }
        for(int x : ans)    cout << " " << x;
        cout << endl << flush;
        int ret;
        cin >> ret;
        if(ret==0) ans.insert(now+1);
        now--;
    }
    cout << "? " << n-1 << endl << flush;
    for(int i = 2; i <= n; i++){
        if(i-2) cout << " ";
        cout << i;
    }
    cout << endl << flush;
    int ret;
    cin >> ret;
    if(ret==0) ans.insert(1);
    cout << "! " << ans.size() << endl << flush;
    for(auto it = ans.begin(); it != ans.end(); it++){
        if(it != ans.begin())   cout << " ";
        cout << *it;
    }
    cout << endl;
    return 0;
}
0