結果

問題 No.934 Explosive energy drink
ユーザー okok
提出日時 2019-11-29 23:23:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 991 bytes
コンパイル時間 906 ms
コンパイル使用メモリ 84,824 KB
実行使用メモリ 24,276 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 19:03:01
合計ジャッジ時間 5,937 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
24,264 KB
testcase_01 AC 313 ms
23,412 KB
testcase_02 AC 24 ms
24,000 KB
testcase_03 AC 157 ms
24,276 KB
testcase_04 AC 325 ms
24,012 KB
testcase_05 AC 26 ms
23,412 KB
testcase_06 AC 25 ms
23,640 KB
testcase_07 AC 25 ms
23,376 KB
testcase_08 AC 25 ms
24,276 KB
testcase_09 AC 25 ms
23,364 KB
testcase_10 AC 25 ms
23,964 KB
testcase_11 AC 24 ms
23,400 KB
testcase_12 AC 27 ms
24,012 KB
testcase_13 AC 31 ms
23,364 KB
testcase_14 AC 32 ms
23,640 KB
testcase_15 AC 108 ms
23,412 KB
testcase_16 AC 41 ms
23,628 KB
testcase_17 AC 64 ms
23,628 KB
testcase_18 AC 63 ms
23,364 KB
testcase_19 AC 125 ms
24,000 KB
testcase_20 AC 206 ms
23,652 KB
testcase_21 AC 217 ms
23,412 KB
testcase_22 AC 305 ms
23,376 KB
testcase_23 AC 316 ms
23,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

signed main(){
	// cin.tie(nullptr);
	// ios::sync_with_stdio(false);
	// cout<<fixed<<setprecision(10);
	
	int N;
	vector<int> ans;
	
	cin>>N;
	
	for(int i = 1; i <= N; i++){
		bool flag = true, flag2 = false;
		
		cout<<"? "<<N-1<<endl;
		
		for(int j = 1; j <= N; j++){
			if(i == j) continue;
			
			if(flag2) cout<<" ";
			
			cout<<j;
			
			flag2 = true;
		}
		cout<<endl;
		cout<<flush;
		
		int a;
		
		cin>>a;
		
		if(!a) ans.push_back(i);
	}
	
	sort(ans.begin(), ans.end());
	
	cout<<"! "<<ans.size()<<endl;
	
	for(int i = 0; i < ans.size(); i++){
		if(i) cout<<" ";
		cout<<ans[i];
		cout<<flush;
	}
	cout<<endl;
	
	cout<<flush;
	return 0;
}
0