結果

問題 No.934 Explosive energy drink
ユーザー SSRSSSRS
提出日時 2020-11-10 08:15:51
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 328 ms / 2,000 ms
コード長 613 bytes
コンパイル時間 694 ms
コンパイル使用メモリ 70,920 KB
実行使用メモリ 24,348 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-24 07:04:14
合計ジャッジ時間 5,847 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
24,084 KB
testcase_01 AC 328 ms
24,012 KB
testcase_02 AC 27 ms
24,036 KB
testcase_03 AC 164 ms
23,376 KB
testcase_04 AC 323 ms
23,508 KB
testcase_05 AC 30 ms
24,036 KB
testcase_06 AC 27 ms
24,048 KB
testcase_07 AC 28 ms
24,252 KB
testcase_08 AC 27 ms
24,336 KB
testcase_09 AC 27 ms
24,240 KB
testcase_10 AC 27 ms
23,520 KB
testcase_11 AC 27 ms
23,508 KB
testcase_12 AC 30 ms
23,820 KB
testcase_13 AC 31 ms
24,336 KB
testcase_14 AC 33 ms
24,348 KB
testcase_15 AC 109 ms
23,628 KB
testcase_16 AC 44 ms
24,048 KB
testcase_17 AC 69 ms
24,288 KB
testcase_18 AC 69 ms
23,820 KB
testcase_19 AC 128 ms
23,364 KB
testcase_20 AC 209 ms
24,000 KB
testcase_21 AC 225 ms
24,276 KB
testcase_22 AC 317 ms
23,628 KB
testcase_23 AC 316 ms
24,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int N;
	cin >> N;
	vector<int> b;
	for (int i = 0; i < N; i++){
		vector<int> a;
		for (int j = 0; j < N; j++){
			if (i != j){
				a.push_back(j);
			}
		}
		cout << '?' << ' ' << N - 1 << endl;
		for (int j = 0; j < N - 1; j++){
			cout << a[j] + 1;
			if (j < N - 2){
				cout << ' ';
			}
		}
		cout << endl;
		int ans;
		cin >> ans;
		if (ans == 0){
			b.push_back(i);
		}
	}
	int K = b.size();
	cout << '!' << ' ' << K << endl;
	for (int i = 0; i < K; i++){
		cout << b[i] + 1;
		if (i < K - 1){
			cout << ' ';
		}
	}
	cout << endl;
}
0