結果

問題 No.934 Explosive energy drink
ユーザー minatominato
提出日時 2019-11-29 22:26:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 2,136 ms
コンパイル使用メモリ 167,036 KB
実行使用メモリ 24,432 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:46:45
合計ジャッジ時間 6,654 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,288 KB
testcase_01 AC 322 ms
23,352 KB
testcase_02 AC 24 ms
24,024 KB
testcase_03 AC 164 ms
23,436 KB
testcase_04 AC 328 ms
23,844 KB
testcase_05 AC 25 ms
23,928 KB
testcase_06 AC 24 ms
23,568 KB
testcase_07 AC 24 ms
23,352 KB
testcase_08 AC 26 ms
24,384 KB
testcase_09 AC 24 ms
23,928 KB
testcase_10 AC 26 ms
24,072 KB
testcase_11 AC 25 ms
24,432 KB
testcase_12 AC 27 ms
24,036 KB
testcase_13 AC 31 ms
23,676 KB
testcase_14 AC 31 ms
23,928 KB
testcase_15 AC 108 ms
24,252 KB
testcase_16 AC 45 ms
23,688 KB
testcase_17 AC 67 ms
23,652 KB
testcase_18 AC 68 ms
23,988 KB
testcase_19 AC 127 ms
23,580 KB
testcase_20 AC 212 ms
23,856 KB
testcase_21 AC 223 ms
23,928 KB
testcase_22 AC 317 ms
24,240 KB
testcase_23 AC 316 ms
23,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
const double PI = acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;

int main() {
  int N; cin >> N;
  vector<int> a(N),b(0);

  int K = 0;
  rep(i,N) {
    cout << "? " << N-1 << endl;
    rep(j,N) {
      if (i == j) continue;
      cout << j+1 << " ";
    }
    cout << endl;

    int ans; cin >> ans;
    if (ans == 0) {
      K++;
      b.push_back(i+1);
    }   
  }

  cout << "! " << K << endl;
  rep(i,b.size()) cout << b[i] << " ";
  cout << endl;
}
0