結果

問題 No.934 Explosive energy drink
ユーザー finefine
提出日時 2019-11-29 22:30:54
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 795 bytes
コンパイル時間 3,254 ms
コンパイル使用メモリ 167,500 KB
実行使用メモリ 24,336 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:49:34
合計ジャッジ時間 8,582 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
24,192 KB
testcase_01 AC 317 ms
23,460 KB
testcase_02 AC 27 ms
24,048 KB
testcase_03 AC 162 ms
24,336 KB
testcase_04 AC 316 ms
23,700 KB
testcase_05 AC 28 ms
24,096 KB
testcase_06 AC 27 ms
23,496 KB
testcase_07 AC 27 ms
23,472 KB
testcase_08 AC 52 ms
23,688 KB
testcase_09 AC 27 ms
24,060 KB
testcase_10 AC 28 ms
24,192 KB
testcase_11 AC 28 ms
23,568 KB
testcase_12 AC 29 ms
23,304 KB
testcase_13 AC 33 ms
24,252 KB
testcase_14 AC 34 ms
23,688 KB
testcase_15 AC 108 ms
24,072 KB
testcase_16 AC 44 ms
23,640 KB
testcase_17 AC 66 ms
23,700 KB
testcase_18 AC 67 ms
23,556 KB
testcase_19 AC 124 ms
23,964 KB
testcase_20 AC 206 ms
23,460 KB
testcase_21 AC 222 ms
23,448 KB
testcase_22 AC 314 ms
23,928 KB
testcase_23 AC 320 ms
23,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;

    vector<int> ans;
    for (int i = 1; i <= n; i++) {
        cout << "? " << n - 1 << endl;
        for (int j = 1; j <= n; j++) {
            if (j == i) {
                if (j == n) cout << endl;
                continue;
            }

            cout << j;
            if (j == n) cout << endl;
            else cout << " ";
        }

        int query;
        cin >> query;
        if (query == 0) ans.push_back(i);
    }

    cout << "! " << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i];
        if (i + 1 == ans.size()) cout << endl;
        else cout << " ";
    }
    return 0;
}
0