結果

問題 No.934 Explosive energy drink
ユーザー tonyu0tonyu0
提出日時 2019-11-29 22:40:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 317 ms / 2,000 ms
コード長 719 bytes
コンパイル時間 865 ms
コンパイル使用メモリ 93,396 KB
実行使用メモリ 24,204 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:52:21
合計ジャッジ時間 5,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,292 KB
testcase_01 AC 316 ms
23,280 KB
testcase_02 AC 26 ms
23,316 KB
testcase_03 AC 161 ms
23,544 KB
testcase_04 AC 316 ms
24,204 KB
testcase_05 AC 28 ms
23,556 KB
testcase_06 AC 27 ms
24,096 KB
testcase_07 AC 27 ms
23,520 KB
testcase_08 AC 27 ms
23,280 KB
testcase_09 AC 26 ms
23,400 KB
testcase_10 AC 27 ms
23,496 KB
testcase_11 AC 28 ms
23,532 KB
testcase_12 AC 29 ms
23,556 KB
testcase_13 AC 32 ms
23,292 KB
testcase_14 AC 33 ms
23,904 KB
testcase_15 AC 107 ms
23,292 KB
testcase_16 AC 42 ms
23,304 KB
testcase_17 AC 66 ms
23,388 KB
testcase_18 AC 66 ms
23,280 KB
testcase_19 AC 124 ms
23,328 KB
testcase_20 AC 206 ms
23,676 KB
testcase_21 AC 221 ms
23,400 KB
testcase_22 AC 310 ms
23,916 KB
testcase_23 AC 317 ms
24,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <iomanip>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
constexpr ll MOD = 1e9 + 7;
constexpr int INF = 1 << 30;

int main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int N; cin >> N;

  bool res;
  vector<int> ans;
  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;
    cin >> res;
    if(!res) ans.push_back(i);
  }

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