結果

問題 No.934 Explosive energy drink
ユーザー どららどらら
提出日時 2019-11-29 23:02:21
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 859 bytes
コンパイル時間 3,045 ms
コンパイル使用メモリ 168,424 KB
実行使用メモリ 24,324 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:58:11
合計ジャッジ時間 9,140 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,252 KB
testcase_01 AC 305 ms
23,448 KB
testcase_02 AC 23 ms
23,940 KB
testcase_03 AC 153 ms
23,556 KB
testcase_04 AC 302 ms
23,316 KB
testcase_05 AC 22 ms
24,324 KB
testcase_06 AC 22 ms
23,304 KB
testcase_07 AC 22 ms
23,628 KB
testcase_08 AC 22 ms
23,928 KB
testcase_09 AC 22 ms
23,364 KB
testcase_10 AC 24 ms
23,496 KB
testcase_11 AC 23 ms
24,252 KB
testcase_12 AC 25 ms
23,640 KB
testcase_13 AC 27 ms
23,556 KB
testcase_14 AC 28 ms
23,580 KB
testcase_15 AC 104 ms
23,940 KB
testcase_16 AC 42 ms
23,760 KB
testcase_17 AC 60 ms
23,928 KB
testcase_18 AC 63 ms
24,228 KB
testcase_19 AC 117 ms
23,544 KB
testcase_20 AC 193 ms
23,760 KB
testcase_21 AC 209 ms
23,940 KB
testcase_22 AC 291 ms
23,940 KB
testcase_23 AC 303 ms
23,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int N;
  cin >> N;

  vector<int> v(N, 1);
  rep(i,N){
    cout << "? " << N-1 << endl;
    bool flg = false;
    vector<int> tmp;
    rep(j,N){
      if(i != j) tmp.push_back(j+1);
    }
    rep(j,tmp.size()){
      if(j>0) cout << " ";
      cout << tmp[j];
    }
    cout << endl;
    int res;
    cin >> res;
    v[i] = res;
  }

  vector<int> ret;
  rep(i,N) if(v[i] == 0) ret.push_back(i+1);
  
  cout << "! " << ret.size() << endl;
  rep(i,ret.size()){
    if(i>0) cout << " ";
    cout << ret[i];
  }
  cout << endl;
  
  return 0;
}

0