結果

問題 No.934 Explosive energy drink
ユーザー chocoruskchocorusk
提出日時 2019-11-29 21:58:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 329 ms / 2,000 ms
コード長 1,126 bytes
コンパイル時間 992 ms
コンパイル使用メモリ 111,364 KB
実行使用メモリ 24,468 KB
平均クエリ数 709.08
最終ジャッジ日時 2023-09-23 18:27:04
合計ジャッジ時間 4,998 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,628 KB
testcase_01 AC 197 ms
23,364 KB
testcase_02 AC 26 ms
24,300 KB
testcase_03 AC 108 ms
23,376 KB
testcase_04 AC 329 ms
23,412 KB
testcase_05 AC 25 ms
23,424 KB
testcase_06 AC 25 ms
23,976 KB
testcase_07 AC 25 ms
23,628 KB
testcase_08 AC 25 ms
23,988 KB
testcase_09 AC 25 ms
24,324 KB
testcase_10 AC 25 ms
23,556 KB
testcase_11 AC 25 ms
23,964 KB
testcase_12 AC 26 ms
23,952 KB
testcase_13 AC 30 ms
23,664 KB
testcase_14 AC 30 ms
23,616 KB
testcase_15 AC 109 ms
23,964 KB
testcase_16 AC 37 ms
24,240 KB
testcase_17 AC 52 ms
24,468 KB
testcase_18 AC 57 ms
23,964 KB
testcase_19 AC 87 ms
23,832 KB
testcase_20 AC 141 ms
23,640 KB
testcase_21 AC 142 ms
23,988 KB
testcase_22 AC 193 ms
23,340 KB
testcase_23 AC 191 ms
24,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n;
	cin>>n;
	vector<int> ans;
	bool used[1010]={};
	for(int i=2; i<=n+1; i++){
		int m=ans.size()+n-i+1;
		if(m==1 && i==n){
			cout<<"! "<<2<<"\n";
			cout<<n-1<<" "<<n<<endl;
			return 0;
		}
		if(m==1 && i==n+1){
			cout<<"! "<<2<<"\n";
			cout<<ans[0]<<" "<<n<<endl;
			return 0;
		}
		cout<<"? "<<m<<"\n";
		for(auto x:ans) cout<<x<<" ";
		for(int j=i; j<=n; j++) cout<<j<<" ";
		cout<<endl;
		int r;
		cin>>r;
		if(r==0){
			ans.push_back(i-1);
			used[i-1]=1;
		}
	}
	cout<<"! "<<ans.size()<<"\n";
	for(auto x:ans){
		cout<<x<<" ";
	}
	cout<<endl;
	return 0;
}
0