結果

問題 No.934 Explosive energy drink
ユーザー ktr216ktr216
提出日時 2019-11-29 22:46:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 593 bytes
コンパイル時間 1,840 ms
コンパイル使用メモリ 166,200 KB
実行使用メモリ 24,420 KB
平均クエリ数 709.50
最終ジャッジ日時 2023-09-23 18:53:38
合計ジャッジ時間 7,467 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 203 ms
24,420 KB
testcase_02 AC 28 ms
24,000 KB
testcase_03 AC 114 ms
24,408 KB
testcase_04 AC 337 ms
24,348 KB
testcase_05 AC 28 ms
23,592 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 28 ms
23,616 KB
testcase_10 AC 30 ms
24,336 KB
testcase_11 AC 28 ms
24,336 KB
testcase_12 AC 29 ms
23,352 KB
testcase_13 AC 32 ms
24,336 KB
testcase_14 AC 36 ms
24,192 KB
testcase_15 AC 112 ms
23,976 KB
testcase_16 AC 45 ms
23,964 KB
testcase_17 AC 53 ms
24,408 KB
testcase_18 AC 58 ms
23,976 KB
testcase_19 AC 90 ms
24,192 KB
testcase_20 AC 145 ms
23,616 KB
testcase_21 AC 145 ms
24,336 KB
testcase_22 AC 198 ms
23,976 KB
testcase_23 AC 203 ms
24,252 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--;
        }
    }
    cout << "! " << K << endl;
    rep(i, N) {
        if (!f[i]) cout << i + 1 << " ";
    }
    cout << endl;
}
0