結果

問題 No.934 Explosive energy drink
ユーザー toto6114toto6114
提出日時 2019-11-30 01:25:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 859 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 95,580 KB
実行使用メモリ 24,348 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 19:07:43
合計ジャッジ時間 4,496 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,012 KB
testcase_01 AC 182 ms
23,376 KB
testcase_02 AC 24 ms
23,652 KB
testcase_03 AC 100 ms
23,652 KB
testcase_04 AC 302 ms
24,000 KB
testcase_05 AC 24 ms
23,796 KB
testcase_06 AC 24 ms
23,628 KB
testcase_07 AC 22 ms
23,364 KB
testcase_08 AC 23 ms
23,796 KB
testcase_09 AC 24 ms
24,348 KB
testcase_10 AC 24 ms
24,024 KB
testcase_11 AC 23 ms
24,324 KB
testcase_12 AC 26 ms
23,640 KB
testcase_13 AC 26 ms
24,300 KB
testcase_14 AC 30 ms
23,664 KB
testcase_15 AC 104 ms
24,036 KB
testcase_16 AC 37 ms
24,024 KB
testcase_17 AC 50 ms
24,036 KB
testcase_18 AC 54 ms
24,336 KB
testcase_19 AC 80 ms
24,180 KB
testcase_20 AC 127 ms
24,024 KB
testcase_21 AC 133 ms
24,012 KB
testcase_22 AC 181 ms
23,508 KB
testcase_23 AC 181 ms
23,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> ans;
  for(int i=1; i<=n; i++) {
    vector<int> v=ans;
    for(int j=i+1; j<=n; j++) {
      v.push_back(j);
    }
    if(v.size()<2) {
      ans.push_back(i);
      continue;
    }
    cout << '?' << " " << v.size() << endl;
    for(int j=0; j<v.size()-1; j++) {
      cout << v[j] << " ";
    }
    cout << v[v.size()-1] << endl;
    int x;
    cin >> x;
    if(!x) {
      ans.push_back(i);
    }
  }
  cout << '!' << " " << ans.size() << endl;
  for(int i=0; i<ans.size()-1; i++) {
    cout << ans[i] << " ";
  }
  cout << ans[ans.size()-1] << endl;
}
0