結果

問題 No.934 Explosive energy drink
ユーザー misora192misora192
提出日時 2020-04-25 22:05:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 761 bytes
コンパイル時間 1,642 ms
コンパイル使用メモリ 166,268 KB
実行使用メモリ 24,384 KB
平均クエリ数 709.54
最終ジャッジ日時 2023-09-24 03:20:34
合計ジャッジ時間 5,990 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,060 KB
testcase_01 AC 185 ms
24,108 KB
testcase_02 AC 26 ms
23,664 KB
testcase_03 AC 102 ms
24,324 KB
testcase_04 AC 314 ms
24,252 KB
testcase_05 WA -
testcase_06 AC 25 ms
24,060 KB
testcase_07 AC 26 ms
23,880 KB
testcase_08 AC 26 ms
23,472 KB
testcase_09 AC 25 ms
23,844 KB
testcase_10 AC 26 ms
23,448 KB
testcase_11 AC 26 ms
23,436 KB
testcase_12 AC 28 ms
23,652 KB
testcase_13 AC 29 ms
24,048 KB
testcase_14 AC 32 ms
23,664 KB
testcase_15 AC 105 ms
24,384 KB
testcase_16 AC 39 ms
23,544 KB
testcase_17 AC 50 ms
23,892 KB
testcase_18 AC 55 ms
24,360 KB
testcase_19 AC 84 ms
24,036 KB
testcase_20 AC 133 ms
23,400 KB
testcase_21 AC 134 ms
24,012 KB
testcase_22 AC 183 ms
24,024 KB
testcase_23 AC 186 ms
23,400 KB
権限があれば一括ダウンロードができます

ソースコード

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;
	for(int i = n - 1; i >= 0; i--){
		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