結果

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

ソースコード

diff #

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

int main(){
    int n;
    cin >> n;
    set<int> ans;
    for(int i = 1; i <= n; i++){
        cout << "? " << n-1 << endl;
        bool b = true;
        for(int j = 1; j <= n; j++){
            if(i == j)  continue;
            if(!b)  cout << " ";
            b = false;
            cout << j;
        }
        cout << endl << flush;
        int ret;
        cin >> ret;
        if(ret == 0)    ans.insert(i);
    }
    cout << "! " << ans.size() << endl;
    for(auto it = ans.begin(); it != ans.end(); it++){
        if(it != ans.begin())   cout << " ";
        cout << *it;
    }
    cout << endl;
    return 0;
}
0