結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
23,364 KB
testcase_01 AC 326 ms
24,312 KB
testcase_02 AC 27 ms
24,348 KB
testcase_03 AC 162 ms
23,376 KB
testcase_04 AC 321 ms
24,012 KB
testcase_05 AC 28 ms
23,388 KB
testcase_06 AC 27 ms
24,012 KB
testcase_07 AC 28 ms
23,376 KB
testcase_08 AC 24 ms
24,012 KB
testcase_09 AC 23 ms
23,376 KB
testcase_10 AC 28 ms
23,856 KB
testcase_11 AC 24 ms
24,324 KB
testcase_12 AC 29 ms
23,412 KB
testcase_13 AC 32 ms
24,324 KB
testcase_14 AC 35 ms
24,000 KB
testcase_15 AC 112 ms
23,616 KB
testcase_16 AC 47 ms
23,652 KB
testcase_17 AC 70 ms
23,652 KB
testcase_18 AC 69 ms
23,628 KB
testcase_19 AC 126 ms
23,376 KB
testcase_20 AC 206 ms
23,412 KB
testcase_21 AC 220 ms
23,808 KB
testcase_22 AC 304 ms
23,520 KB
testcase_23 AC 304 ms
23,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int ask(vector<int> V) {
	cout<<"? "<<V.size()<<endl;
	int i;
	FOR(i,V.size()) {
		cout<<V[i]+1;
		if(i<V.size()-1) cout<<" ";
	}
	cout<<endl;
	cin>>i;
	return i;
}



void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	vector<int> out;
	FOR(i,N) {
		vector<int> V;
		FOR(j,N) if(i!=j) V.push_back(j);
		if(ask(V)==0) out.push_back(i+1);
	}
	
	cout<<"! "<<out.size()<<endl;
	FORR(v,out) cout<<v<<" ";
	cout<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0