結果

問題 No.934 Explosive energy drink
コンテスト
ユーザー 0w1
提出日時 2019-11-30 14:17:11
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 248 ms / 2,000 ms
+ 0µs
コード長 607 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,260 ms
コンパイル使用メモリ 214,764 KB
実行使用メモリ 9,720 KB
平均クエリ数 709.58
最終ジャッジ日時 2026-10-24 18:26:04
合計ジャッジ時間 5,049 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);

  int N;
  cin >> N;

  auto query = [N](int v) {
    cout << "? " << N - 1 << endl;
    for (int i = 0; i < N; ++i) {
      if (i == v) continue;
      cout << i + 1 << " ";
    }
    cout << endl;
    int res;
    cin >> res;
    return res;
  };

  vector<int> need;
  for (int i = 0; i < N; ++i) {
    if (!query(i)) {
      need.push_back(i);
    }
  }

  cout << "! " << need.size() << endl;
  for (int i = 0; i < need.size(); ++i) {
    cout << need[i] + 1 << " \n"[i + 1 == need.size()];
  }

  return 0;
}
0