結果

問題 No.934 Explosive energy drink
ユーザー hipopohipopo
提出日時 2020-01-10 14:40:53
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 703 bytes
コンパイル時間 5,144 ms
コンパイル使用メモリ 199,724 KB
実行使用メモリ 24,456 KB
平均クエリ数 708.58
最終ジャッジ日時 2023-09-23 19:25:26
合計ジャッジ時間 7,610 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,652 KB
testcase_01 AC 297 ms
23,832 KB
testcase_02 AC 24 ms
23,964 KB
testcase_03 AC 150 ms
24,000 KB
testcase_04 AC 296 ms
24,456 KB
testcase_05 AC 25 ms
23,832 KB
testcase_06 AC 23 ms
23,664 KB
testcase_07 AC 23 ms
23,640 KB
testcase_08 AC 24 ms
23,832 KB
testcase_09 AC 23 ms
23,676 KB
testcase_10 AC 23 ms
23,604 KB
testcase_11 AC 24 ms
23,580 KB
testcase_12 AC 25 ms
24,444 KB
testcase_13 AC 27 ms
23,676 KB
testcase_14 AC 30 ms
23,424 KB
testcase_15 AC 104 ms
23,568 KB
testcase_16 AC 41 ms
24,312 KB
testcase_17 AC 60 ms
23,532 KB
testcase_18 AC 64 ms
23,976 KB
testcase_19 AC 123 ms
23,364 KB
testcase_20 AC 202 ms
23,568 KB
testcase_21 AC 207 ms
23,664 KB
testcase_22 AC 296 ms
23,592 KB
testcase_23 AC 313 ms
23,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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