結果

問題 No.934 Explosive energy drink
ユーザー iqueue02
提出日時 2020-07-29 12:06:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 639 bytes
コンパイル時間 2,042 ms
コンパイル使用メモリ 195,252 KB
最終ジャッジ日時 2025-01-12 07:31:30
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;

int main() {
  int n;
  cin >> n;
  vector<int> res;
  for (int i = 1; i <= n; i++) {
    cout << '?' << " " << n - 1 << endl;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      cout << j << " ";
    }
    cout << endl;
    cout.flush();
    int x;
    cin >> x;
    if (!x) res.emplace_back(i);
  }
  cout << '!' << " " << res.size() << endl;
  for (auto e : res) cout << e << " ";
  cout << endl;
  cout.flush();

  return 0;
} 
0