結果

問題 No.934 Explosive energy drink
ユーザー edamame882edamame882
提出日時 2019-11-29 22:10:34
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 306 ms / 2,000 ms
コード長 1,340 bytes
コンパイル時間 3,907 ms
コンパイル使用メモリ 164,288 KB
実行使用メモリ 24,324 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 18:33:38
合計ジャッジ時間 8,073 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
23,652 KB
testcase_01 AC 189 ms
24,264 KB
testcase_02 AC 24 ms
24,012 KB
testcase_03 AC 102 ms
24,276 KB
testcase_04 AC 306 ms
23,364 KB
testcase_05 AC 26 ms
24,276 KB
testcase_06 AC 25 ms
23,604 KB
testcase_07 AC 26 ms
23,400 KB
testcase_08 AC 26 ms
23,232 KB
testcase_09 AC 26 ms
23,652 KB
testcase_10 AC 26 ms
23,928 KB
testcase_11 AC 26 ms
23,616 KB
testcase_12 AC 27 ms
24,000 KB
testcase_13 AC 30 ms
23,676 KB
testcase_14 AC 31 ms
24,264 KB
testcase_15 AC 102 ms
23,592 KB
testcase_16 AC 38 ms
23,808 KB
testcase_17 AC 50 ms
24,324 KB
testcase_18 AC 55 ms
23,640 KB
testcase_19 AC 83 ms
23,412 KB
testcase_20 AC 132 ms
23,364 KB
testcase_21 AC 132 ms
24,204 KB
testcase_22 AC 170 ms
24,036 KB
testcase_23 AC 176 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  bool ok[n];
  memset(ok,true,sizeof(ok));

  int out = n;
  rep(i,n){
    if(out == 2) break;
    cout << "? " << out - 1 << endl;
    rep(j,n){
      if(ok[j] && j != i){
        cout << j+1 << " ";
      }
    }
    cout << endl;
    int res;
    cin >> res ;
    if(res == 1){
      ok[i] = false;
      out--;
    } 
  }
  cout << "! " << out << endl;
  rep(i,n){
    if(ok[i]) cout << i+1 << " ";
  }
  cout << endl;
  return 0;
}
0