結果

問題 No.934 Explosive energy drink
ユーザー koi_kotyakoi_kotya
提出日時 2019-11-29 21:59:45
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 296 ms / 2,000 ms
コード長 1,114 bytes
コンパイル時間 2,348 ms
コンパイル使用メモリ 168,488 KB
実行使用メモリ 24,276 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:27:21
合計ジャッジ時間 7,233 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,376 KB
testcase_01 AC 289 ms
23,376 KB
testcase_02 AC 23 ms
23,988 KB
testcase_03 AC 148 ms
24,276 KB
testcase_04 AC 296 ms
23,388 KB
testcase_05 AC 25 ms
24,240 KB
testcase_06 AC 23 ms
24,012 KB
testcase_07 AC 23 ms
23,496 KB
testcase_08 AC 23 ms
23,412 KB
testcase_09 AC 24 ms
23,484 KB
testcase_10 AC 24 ms
23,376 KB
testcase_11 AC 24 ms
23,604 KB
testcase_12 AC 25 ms
23,988 KB
testcase_13 AC 27 ms
23,412 KB
testcase_14 AC 29 ms
23,532 KB
testcase_15 AC 96 ms
23,340 KB
testcase_16 AC 39 ms
23,820 KB
testcase_17 AC 60 ms
23,484 KB
testcase_18 AC 59 ms
24,252 KB
testcase_19 AC 113 ms
23,376 KB
testcase_20 AC 190 ms
23,604 KB
testcase_21 AC 202 ms
23,820 KB
testcase_22 AC 289 ms
23,640 KB
testcase_23 AC 285 ms
23,532 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) 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