結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 182 ms
23,436 KB
testcase_02 AC 24 ms
23,688 KB
testcase_03 AC 105 ms
23,868 KB
testcase_04 AC 298 ms
23,472 KB
testcase_05 AC 25 ms
24,072 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 24 ms
23,700 KB
testcase_10 AC 24 ms
23,688 KB
testcase_11 AC 27 ms
24,300 KB
testcase_12 AC 25 ms
23,460 KB
testcase_13 AC 28 ms
23,436 KB
testcase_14 AC 30 ms
23,592 KB
testcase_15 AC 100 ms
24,060 KB
testcase_16 AC 38 ms
23,700 KB
testcase_17 AC 50 ms
23,460 KB
testcase_18 AC 52 ms
23,676 KB
testcase_19 AC 82 ms
23,424 KB
testcase_20 AC 129 ms
24,312 KB
testcase_21 AC 134 ms
23,868 KB
testcase_22 AC 176 ms
23,892 KB
testcase_23 AC 181 ms
24,072 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;
	
	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