結果

問題 No.934 Explosive energy drink
ユーザー ecto0310ecto0310
提出日時 2019-11-29 23:20:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 2,000 ms
コード長 603 bytes
コンパイル時間 1,523 ms
コンパイル使用メモリ 166,096 KB
実行使用メモリ 24,324 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 19:02:34
合計ジャッジ時間 5,752 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
24,204 KB
testcase_01 AC 188 ms
23,484 KB
testcase_02 AC 25 ms
23,520 KB
testcase_03 AC 105 ms
24,324 KB
testcase_04 AC 321 ms
23,760 KB
testcase_05 AC 24 ms
24,000 KB
testcase_06 AC 24 ms
24,000 KB
testcase_07 AC 24 ms
23,976 KB
testcase_08 AC 23 ms
23,580 KB
testcase_09 AC 25 ms
24,144 KB
testcase_10 AC 23 ms
23,616 KB
testcase_11 AC 24 ms
23,484 KB
testcase_12 AC 25 ms
23,388 KB
testcase_13 AC 27 ms
24,168 KB
testcase_14 AC 29 ms
23,484 KB
testcase_15 AC 103 ms
23,964 KB
testcase_16 AC 35 ms
24,012 KB
testcase_17 AC 48 ms
23,820 KB
testcase_18 AC 53 ms
23,388 KB
testcase_19 AC 84 ms
23,820 KB
testcase_20 AC 135 ms
23,316 KB
testcase_21 AC 134 ms
23,496 KB
testcase_22 AC 186 ms
23,580 KB
testcase_23 AC 185 ms
23,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main()
{
  i64 n;
  cin >> n;
  i64 cnt = n;
  vector<bool> use(n, true);
  for (i64 i = 0; i < n; i++)
  {
    if (cnt < 3)
      continue;
    use[i] = false;
    cnt--;
    cout << "? " << cnt << "\n";
    for (i64 j = 0; j < n; j++)
      if (use[j])
        cout << j + 1 << " ";
    cout << endl;
    i64 r;
    cin >> r;
    if (r == 0)
    {
      use[i] = true;
      cnt++;
    }
  }
  cout << "! " << cnt << "\n";
  for (i64 j = 0; j < n; j++)
    if (use[j])
      cout << j + 1 << " ";
  cout << endl;
  return 0;
}
0