結果

問題 No.934 Explosive energy drink
ユーザー face4face4
提出日時 2019-11-29 22:05:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 693 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 75,344 KB
実行使用メモリ 24,312 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:31:03
合計ジャッジ時間 5,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,276 KB
testcase_01 AC 301 ms
23,592 KB
testcase_02 AC 23 ms
23,952 KB
testcase_03 AC 153 ms
23,976 KB
testcase_04 AC 311 ms
23,340 KB
testcase_05 AC 24 ms
23,388 KB
testcase_06 AC 23 ms
24,036 KB
testcase_07 AC 24 ms
23,364 KB
testcase_08 AC 24 ms
23,544 KB
testcase_09 AC 23 ms
24,312 KB
testcase_10 AC 23 ms
23,676 KB
testcase_11 AC 26 ms
24,036 KB
testcase_12 AC 26 ms
24,264 KB
testcase_13 AC 28 ms
24,012 KB
testcase_14 AC 30 ms
24,276 KB
testcase_15 AC 103 ms
24,024 KB
testcase_16 AC 41 ms
23,832 KB
testcase_17 AC 62 ms
23,544 KB
testcase_18 AC 64 ms
23,592 KB
testcase_19 AC 118 ms
24,036 KB
testcase_20 AC 196 ms
23,544 KB
testcase_21 AC 215 ms
24,024 KB
testcase_22 AC 299 ms
23,616 KB
testcase_23 AC 313 ms
24,288 KB
権限があれば一括ダウンロードができます

ソースコード

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