結果

問題 No.934 Explosive energy drink
ユーザー ecto0310ecto0310
提出日時 2019-11-29 23:13:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 570 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 166,472 KB
実行使用メモリ 24,348 KB
平均クエリ数 709.50
最終ジャッジ日時 2023-09-23 19:00:01
合計ジャッジ時間 6,283 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 181 ms
23,364 KB
testcase_02 AC 21 ms
23,616 KB
testcase_03 AC 93 ms
24,288 KB
testcase_04 AC 291 ms
24,024 KB
testcase_05 AC 23 ms
23,952 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 21 ms
24,240 KB
testcase_10 AC 23 ms
24,012 KB
testcase_11 AC 23 ms
24,204 KB
testcase_12 AC 22 ms
23,400 KB
testcase_13 AC 25 ms
23,808 KB
testcase_14 AC 26 ms
23,376 KB
testcase_15 AC 94 ms
24,288 KB
testcase_16 AC 33 ms
23,604 KB
testcase_17 AC 43 ms
24,264 KB
testcase_18 AC 47 ms
23,652 KB
testcase_19 AC 75 ms
23,376 KB
testcase_20 AC 123 ms
23,964 KB
testcase_21 AC 125 ms
23,652 KB
testcase_22 AC 174 ms
23,388 KB
testcase_23 AC 177 ms
23,652 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++)
  {
    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