結果

問題 No.934 Explosive energy drink
ユーザー QCFiumQCFium
提出日時 2019-11-11 19:00:55
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 272 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 169,256 KB
実行使用メモリ 24,336 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:19:25
合計ジャッジ時間 5,736 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
23,556 KB
testcase_01 AC 263 ms
24,240 KB
testcase_02 AC 23 ms
24,324 KB
testcase_03 AC 140 ms
23,520 KB
testcase_04 AC 263 ms
23,856 KB
testcase_05 AC 23 ms
23,568 KB
testcase_06 AC 24 ms
23,616 KB
testcase_07 AC 23 ms
24,048 KB
testcase_08 AC 24 ms
23,664 KB
testcase_09 AC 23 ms
24,336 KB
testcase_10 AC 25 ms
23,868 KB
testcase_11 AC 24 ms
23,424 KB
testcase_12 AC 26 ms
23,580 KB
testcase_13 AC 28 ms
23,412 KB
testcase_14 AC 28 ms
23,568 KB
testcase_15 AC 91 ms
23,628 KB
testcase_16 AC 38 ms
23,976 KB
testcase_17 AC 58 ms
24,336 KB
testcase_18 AC 58 ms
24,000 KB
testcase_19 AC 104 ms
24,060 KB
testcase_20 AC 173 ms
23,400 KB
testcase_21 AC 189 ms
23,604 KB
testcase_22 AC 272 ms
24,036 KB
testcase_23 AC 269 ms
23,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri();
	assert(n >= 3);
	std::vector<int> res;
	for (int i = 1; i <= n; i++) {
		std::string query = "? " + std::to_string(n - 1) + "\n";
		for (int j = 1; j <= n; j++) if (i != j) query += std::to_string(j) + " ";
		query.pop_back();
		std::cout << query << std::endl;
		if (!ri()) res.push_back(i);
	}
	std::cout << "! " << res.size() << std::endl;
	for (int i = 0; i < (int) res.size(); i++) {
		if (i) std::cout << " ";
		std::cout << res[i];
	}
	std::cout << std::endl;
	
	return 0;
}
0