結果

問題 No.934 Explosive energy drink
ユーザー trineutrontrineutron
提出日時 2020-02-25 01:01:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 679 bytes
コンパイル時間 2,719 ms
コンパイル使用メモリ 201,048 KB
実行使用メモリ 24,252 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:43:28
合計ジャッジ時間 7,418 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
23,244 KB
testcase_01 AC 298 ms
24,252 KB
testcase_02 AC 23 ms
23,520 KB
testcase_03 AC 151 ms
23,484 KB
testcase_04 AC 296 ms
23,424 KB
testcase_05 AC 24 ms
23,592 KB
testcase_06 AC 23 ms
23,892 KB
testcase_07 AC 22 ms
24,108 KB
testcase_08 AC 22 ms
23,292 KB
testcase_09 AC 22 ms
23,496 KB
testcase_10 AC 22 ms
23,700 KB
testcase_11 AC 24 ms
24,240 KB
testcase_12 AC 24 ms
23,976 KB
testcase_13 AC 27 ms
23,712 KB
testcase_14 AC 29 ms
24,204 KB
testcase_15 AC 99 ms
23,472 KB
testcase_16 AC 41 ms
23,280 KB
testcase_17 AC 61 ms
23,292 KB
testcase_18 AC 63 ms
23,400 KB
testcase_19 AC 117 ms
23,352 KB
testcase_20 AC 193 ms
23,304 KB
testcase_21 AC 211 ms
23,904 KB
testcase_22 AC 291 ms
23,952 KB
testcase_23 AC 294 ms
23,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    vector<int> ans;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cout << "? " << n - 1 << endl;
        for (int j = 0; j < n; j++) {
            if (i == j) continue;
            if (j > 0 && (i > 0 || j >= 2)) cout << " ";
            cout << j + 1;
        }
        cout << endl;
        int e;
        cin >> e;
        if (e == 0) ans.push_back(i + 1);
    }
    cout << "! " << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans.at(i);
        if (i == ans.size() - 1) {
            cout << endl;
        } else {
            cout << " ";
        }
    }
}
0