結果

問題 No.934 Explosive energy drink
ユーザー Mister
提出日時 2020-04-21 19:38:09
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 1,298 ms
コンパイル使用メモリ 75,528 KB
最終ジャッジ日時 2025-01-09 22:05:58
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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