結果

問題 No.934 Explosive energy drink
ユーザー YamaKasaYamaKasa
提出日時 2019-12-03 02:16:31
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 336 ms / 2,000 ms
コード長 868 bytes
コンパイル時間 3,625 ms
コンパイル使用メモリ 163,220 KB
実行使用メモリ 24,168 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:10:49
合計ジャッジ時間 8,307 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,144 KB
testcase_01 AC 327 ms
23,820 KB
testcase_02 AC 26 ms
24,156 KB
testcase_03 AC 164 ms
23,376 KB
testcase_04 AC 331 ms
23,628 KB
testcase_05 AC 27 ms
23,256 KB
testcase_06 AC 26 ms
24,048 KB
testcase_07 AC 26 ms
23,388 KB
testcase_08 AC 26 ms
23,808 KB
testcase_09 AC 26 ms
23,400 KB
testcase_10 AC 26 ms
23,292 KB
testcase_11 AC 25 ms
23,832 KB
testcase_12 AC 27 ms
24,048 KB
testcase_13 AC 30 ms
23,256 KB
testcase_14 AC 31 ms
23,388 KB
testcase_15 AC 108 ms
23,688 KB
testcase_16 AC 42 ms
23,808 KB
testcase_17 AC 66 ms
23,880 KB
testcase_18 AC 67 ms
23,376 KB
testcase_19 AC 127 ms
23,544 KB
testcase_20 AC 212 ms
23,544 KB
testcase_21 AC 228 ms
23,280 KB
testcase_22 AC 321 ms
23,568 KB
testcase_23 AC 336 ms
24,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int N;
    cin >> N;
    int a[N];
    for (int i = 0; i < N; i++) {
        cout << "? " << N - 1 << "\n";
        int t = 0;
        for (int j = 0; j < N; j++) {
            if (j != i) {
                t++;
                if (t == N - 1) {
                    cout << j + 1 << "\n";
                } else {
                    cout << j + 1 << " ";
                }
            }
        }
        cin >> a[i];
    }
    int b = 0;
    for (int i : a) {
        if (i == 0) b++;
    }
    cout << "! "<< b << "\n";
    int c = 0;
    for (int i = 0; i < N; i++) {
        if (a[i] == 0) {
            c++;
            if (c == b) {
                cout << i + 1 << "\n";
            } else {
                cout << i + 1 << " ";
            }
        }
    }
    return 0;
}
0