結果

問題 No.934 Explosive energy drink
ユーザー MisterMister
提出日時 2020-04-21 19:38:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 796 ms
コンパイル使用メモリ 77,824 KB
実行使用メモリ 24,408 KB
平均クエリ数 709.50
最終ジャッジ日時 2023-09-24 03:20:08
合計ジャッジ時間 5,326 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 168 ms
23,520 KB
testcase_02 AC 22 ms
23,232 KB
testcase_03 AC 94 ms
23,532 KB
testcase_04 AC 290 ms
23,856 KB
testcase_05 AC 24 ms
23,964 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 21 ms
23,676 KB
testcase_10 AC 23 ms
23,532 KB
testcase_11 AC 20 ms
23,664 KB
testcase_12 AC 22 ms
24,360 KB
testcase_13 AC 24 ms
23,676 KB
testcase_14 AC 26 ms
24,048 KB
testcase_15 AC 93 ms
24,048 KB
testcase_16 AC 35 ms
23,376 KB
testcase_17 AC 46 ms
24,408 KB
testcase_18 AC 48 ms
23,412 KB
testcase_19 AC 74 ms
24,048 KB
testcase_20 AC 119 ms
23,544 KB
testcase_21 AC 123 ms
24,372 KB
testcase_22 AC 167 ms
23,664 KB
testcase_23 AC 175 ms
23,532 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <set>

bool query(const std::set<int>& xs, int ty) {
    std::cout << "?!"[ty] << " " << xs.size() << std::endl;
    for (auto x : xs) std::cout << x << " ";
    std::cout << std::endl;

    if (ty == 1) return true;

    bool res;
    std::cin >> res;
    return res;
}

void solve() {
    int n;
    std::cin >> n;

    std::set<int> xs;
    for (int i = 1; i <= n; ++i) xs.insert(i);

    for (int i = 1; i <= n; ++i) {
        xs.erase(i);
        if (!query(xs, 0)) xs.insert(i);
    }

    query(xs, 1);
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
0