結果

問題 No.934 Explosive energy drink
ユーザー risujirohrisujiroh
提出日時 2019-11-29 21:57:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 316 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 2,395 ms
コンパイル使用メモリ 167,468 KB
実行使用メモリ 24,324 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:26:40
合計ジャッジ時間 6,525 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,580 KB
testcase_01 AC 314 ms
23,628 KB
testcase_02 AC 27 ms
23,604 KB
testcase_03 AC 161 ms
24,204 KB
testcase_04 AC 314 ms
24,240 KB
testcase_05 AC 27 ms
23,484 KB
testcase_06 AC 26 ms
23,580 KB
testcase_07 AC 26 ms
24,312 KB
testcase_08 AC 27 ms
23,328 KB
testcase_09 AC 27 ms
24,264 KB
testcase_10 AC 26 ms
24,024 KB
testcase_11 AC 27 ms
23,964 KB
testcase_12 AC 30 ms
24,324 KB
testcase_13 AC 32 ms
23,340 KB
testcase_14 AC 32 ms
23,580 KB
testcase_15 AC 108 ms
24,240 KB
testcase_16 AC 43 ms
23,328 KB
testcase_17 AC 65 ms
23,760 KB
testcase_18 AC 65 ms
23,628 KB
testcase_19 AC 124 ms
23,580 KB
testcase_20 AC 207 ms
24,000 KB
testcase_21 AC 221 ms
23,376 KB
testcase_22 AC 310 ms
23,760 KB
testcase_23 AC 316 ms
23,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int n;
  cin >> n;
  vector<int> res;
  for (int i = 0; i < n; ++i) {
    cout << "? " << n - 1 << '\n';
    bool f = true;
    for (int j = 0; j < n; ++j) {
      if (j != i) {
        if (!f) {
          cout << ' ';
        }
        f = false;
        cout << j + 1;
      }
    }
    cout << endl;
    int ans;
    cin >> ans;
    if (ans == 0) {
      res.push_back(i);
    }
  }
  int k = res.size();
  cout << "! " << k << '\n';
  for (int i = 0; i < k; ++i) {
    cout << res[i] + 1 << " \n"[i == k - 1];
  }
}
0