結果

問題 No.934 Explosive energy drink
ユーザー beetbeet
提出日時 2019-11-29 22:01:28
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 598 bytes
コンパイル時間 2,896 ms
コンパイル使用メモリ 203,792 KB
実行使用メモリ 24,420 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:28:29
合計ジャッジ時間 7,124 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
24,420 KB
testcase_01 AC 308 ms
23,676 KB
testcase_02 AC 24 ms
23,808 KB
testcase_03 AC 156 ms
23,604 KB
testcase_04 AC 298 ms
23,460 KB
testcase_05 AC 24 ms
23,376 KB
testcase_06 AC 24 ms
23,640 KB
testcase_07 AC 23 ms
23,580 KB
testcase_08 AC 22 ms
24,288 KB
testcase_09 AC 23 ms
24,012 KB
testcase_10 AC 24 ms
23,448 KB
testcase_11 AC 24 ms
23,580 KB
testcase_12 AC 25 ms
23,580 KB
testcase_13 AC 29 ms
23,424 KB
testcase_14 AC 31 ms
23,568 KB
testcase_15 AC 101 ms
23,472 KB
testcase_16 AC 42 ms
23,328 KB
testcase_17 AC 64 ms
24,084 KB
testcase_18 AC 63 ms
23,364 KB
testcase_19 AC 116 ms
23,664 KB
testcase_20 AC 202 ms
23,592 KB
testcase_21 AC 219 ms
24,276 KB
testcase_22 AC 295 ms
24,000 KB
testcase_23 AC 305 ms
23,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
int ask(int n,int e){
  cout<<"? "<<n-1<<endl;
  for(int i=0;i<n;i++)
    if(i!=e) cout<<" "<<i+1;
  cout<<endl;
  int res;
  cin>>res;
  return res;
}

signed main(){
  int n;
  cin>>n;
  set<int> ans;
  for(int i=0;i<n;i++)
    if(!ask(n,i)) ans.emplace(i);
  cout<<"! "<<ans.size()<<endl;
  for(int b:ans) cout<<b+1<<" ";
  cout<<endl;
  return 0;
}
0