結果

問題 No.934 Explosive energy drink
コンテスト
ユーザー a01sa01to
提出日時 2025-12-19 00:31:49
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 589 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,986 ms
コンパイル使用メモリ 338,672 KB
実行使用メモリ 9,420 KB
平均クエリ数 709.33
最終ジャッジ日時 2026-07-19 16:08:28
合計ジャッジ時間 6,340 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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

inline int Query(const set<int>& st) {
  cout << "? " << st.size() << '\n';
  for (int x : st) cout << x + 1 << ' ';
  cout << endl;
  int x;
  cin >> x;
  return x;
}

int main() {
  int n;
  cin >> n;
  set<int> st;
  rep(i, n) st.insert(i);
  rep(i, n) {
    st.erase(i);
    int x = Query(st);
    if (x == 0) st.insert(i);
  }
  cout << "! " << st.size() << '\n';
  for (int x : st) cout << x + 1 << ' ';
  cout << endl;
  return 0;
}
0