結果

問題 No.934 Explosive energy drink
コンテスト
ユーザー hipopo
提出日時 2020-01-10 14:40:53
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 686 ms / 2,000 ms
+ 0µs
コード長 703 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,256 ms
コンパイル使用メモリ 215,168 KB
実行使用メモリ 9,776 KB
平均クエリ数 708.58
最終ジャッジ日時 2026-10-25 04:35:47
合計ジャッジ時間 6,055 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

using ll = long long;

int main() {
    int n;
    cin >> n;
    vector<bool> use(n + 1);
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        cout << "? " << n - 1 << endl;
        for (int j = 1; j <= n; j++) {
            if (i == j) continue;

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

        int ans;
        cin >> ans;

        use.at(i) = 1 - ans;
        cnt += 1 - ans;
    }

    cout << "! " << cnt << endl;
    for (int i = 1; i <= n; i++) {
        if (use.at(i)) {
            cout << i;
            if (i != n) cout << " ";
            else cout << endl;
        }
    }
}
0