結果

問題 No.934 Explosive energy drink
ユーザー koi_kotyakoi_kotya
提出日時 2019-11-29 21:56:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,126 bytes
コンパイル時間 2,080 ms
コンパイル使用メモリ 168,200 KB
実行使用メモリ 24,456 KB
平均クエリ数 709.42
最終ジャッジ日時 2023-09-23 18:25:55
合計ジャッジ時間 7,112 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 188 ms
24,240 KB
testcase_02 AC 26 ms
24,012 KB
testcase_03 AC 104 ms
23,520 KB
testcase_04 AC 314 ms
24,300 KB
testcase_05 AC 25 ms
23,376 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 25 ms
23,328 KB
testcase_10 AC 25 ms
23,364 KB
testcase_11 AC 26 ms
24,012 KB
testcase_12 AC 27 ms
23,388 KB
testcase_13 AC 29 ms
23,580 KB
testcase_14 AC 31 ms
23,592 KB
testcase_15 AC 106 ms
23,328 KB
testcase_16 AC 37 ms
23,628 KB
testcase_17 AC 50 ms
24,204 KB
testcase_18 AC 54 ms
23,352 KB
testcase_19 AC 84 ms
24,312 KB
testcase_20 AC 135 ms
24,288 KB
testcase_21 AC 137 ms
23,388 KB
testcase_22 AC 188 ms
23,520 KB
testcase_23 AC 190 ms
24,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

int main() {
    int n;
    cin >> n;
    vector<bool> ans(n,false);
    for (int i = 0;i < n;++i) {
        vector<int> q;
        for (int j = 0;j < i;++j) if (ans[j]) q.push_back(j);
        for (int j = i+1;j < n;++j) q.push_back(j);
        int m = q.size();
        cout << "? "<< m << "\n";
        for (int j = 0;j < m;++j) cout << q[j]+1 << " \n"[j == m-1];
        cout << flush;
        int a;
        cin >> a;
        if (a == 0) ans[i] = true;
    }
    vector<int> b;
    for (int i = 0;i < n;++i) if (ans[i]) b.push_back(i);
    int k = b.size();
    cout << "! " << k << "\n";
    for (int i = 0;i < k;++i) cout << b[i]+1 << " \n"[i == k-1];
    return 0;
}
0