結果

問題 No.934 Explosive energy drink
ユーザー face4face4
提出日時 2019-11-29 22:00:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 926 bytes
コンパイル時間 563 ms
コンパイル使用メモリ 74,508 KB
実行使用メモリ 24,312 KB
平均クエリ数 709.54
最終ジャッジ日時 2023-09-23 18:27:43
合計ジャッジ時間 4,758 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
23,604 KB
testcase_01 AC 176 ms
23,628 KB
testcase_02 AC 23 ms
23,424 KB
testcase_03 AC 99 ms
23,832 KB
testcase_04 AC 307 ms
23,640 KB
testcase_05 WA -
testcase_06 AC 24 ms
23,376 KB
testcase_07 AC 24 ms
24,252 KB
testcase_08 AC 24 ms
23,556 KB
testcase_09 AC 24 ms
23,520 KB
testcase_10 AC 24 ms
23,388 KB
testcase_11 AC 24 ms
23,796 KB
testcase_12 AC 26 ms
23,796 KB
testcase_13 AC 29 ms
24,312 KB
testcase_14 AC 30 ms
23,604 KB
testcase_15 AC 102 ms
24,264 KB
testcase_16 AC 38 ms
23,664 KB
testcase_17 AC 50 ms
23,628 KB
testcase_18 AC 55 ms
23,544 KB
testcase_19 AC 81 ms
23,388 KB
testcase_20 AC 127 ms
24,168 KB
testcase_21 AC 129 ms
23,604 KB
testcase_22 AC 179 ms
23,580 KB
testcase_23 AC 184 ms
23,568 KB
権限があれば一括ダウンロードができます

ソースコード

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