結果

問題 No.934 Explosive energy drink
ユーザー misora192
提出日時 2020-04-25 22:10:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 741 bytes
コンパイル時間 1,869 ms
コンパイル使用メモリ 170,772 KB
実行使用メモリ 25,220 KB
平均クエリ数 709.50
最終ジャッジ日時 2024-07-17 03:29:03
合計ジャッジ時間 5,903 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	int m = n;
	vector<bool> use(n, true);
	bool first;
	
	rep(i, n){
		m--;
		use[i] = false;
		cout << "? " << m << endl;
		first = true;
		rep(j, n){
			if(use[j]){
				if(first){
					cout << (j + 1);
					first = false;
				}else{
					cout << " " << (j + 1);
				}
			}
		}
		cout << endl;

		int ans;
		cin >> ans;

		m += 1 - ans;
		use[i] = ans == 0;
	}

	cout << "! " << m << endl;
	first = true;
	rep(j, n){
		if(use[j]){
			if(first){
				cout << (j + 1);
				first = false;
			}else{
				cout << " " << (j + 1);
			}
		}
	}
	cout << endl;

}
0