結果

問題 No.934 Explosive energy drink
ユーザー ktr216ktr216
提出日時 2019-11-29 22:49:09
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 341 ms / 2,000 ms
コード長 624 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 166,844 KB
実行使用メモリ 24,372 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 18:54:09
合計ジャッジ時間 6,368 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,012 KB
testcase_01 AC 202 ms
23,976 KB
testcase_02 AC 27 ms
24,336 KB
testcase_03 AC 112 ms
24,324 KB
testcase_04 AC 341 ms
23,436 KB
testcase_05 AC 27 ms
24,060 KB
testcase_06 AC 26 ms
24,072 KB
testcase_07 AC 27 ms
23,412 KB
testcase_08 AC 28 ms
23,640 KB
testcase_09 AC 27 ms
23,568 KB
testcase_10 AC 30 ms
23,400 KB
testcase_11 AC 27 ms
23,988 KB
testcase_12 AC 30 ms
24,252 KB
testcase_13 AC 33 ms
23,832 KB
testcase_14 AC 34 ms
23,400 KB
testcase_15 AC 112 ms
23,448 KB
testcase_16 AC 42 ms
23,652 KB
testcase_17 AC 54 ms
23,676 KB
testcase_18 AC 59 ms
23,424 KB
testcase_19 AC 90 ms
23,388 KB
testcase_20 AC 147 ms
23,424 KB
testcase_21 AC 148 ms
23,424 KB
testcase_22 AC 206 ms
23,568 KB
testcase_23 AC 200 ms
24,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

using ll = long long;

int main() {
    int N, K, ans;
    cin >> N;
    K = N;
    vector<bool> f(N, false);
    rep(i, N) {
        cout << "? " << K - 1 << endl;
        rep(j, N) {
            if (i == j || f[j]) continue;
            cout << j + 1 << " ";
        }
        cout << endl;
        cin >> ans;
        if (ans == 1) {
            f[i] = true;
            K--;
            if (K == 2) break;
        }
    }
    cout << "! " << K << endl;
    rep(i, N) {
        if (!f[i]) cout << i + 1 << " ";
    }
    cout << endl;
}
0