結果

問題 No.934 Explosive energy drink
ユーザー 👑 はまやんはまやんはまやんはまやん
提出日時 2019-11-29 23:08:56
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 296 ms / 2,000 ms
コード長 2,107 bytes
コンパイル時間 5,113 ms
コンパイル使用メモリ 200,820 KB
実行使用メモリ 24,312 KB
平均クエリ数 709.58
最終ジャッジ日時 2023-09-23 18:58:33
合計ジャッジ時間 6,726 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,312 KB
testcase_01 AC 289 ms
23,424 KB
testcase_02 AC 22 ms
23,796 KB
testcase_03 AC 148 ms
23,532 KB
testcase_04 AC 296 ms
23,520 KB
testcase_05 AC 23 ms
23,940 KB
testcase_06 AC 22 ms
23,316 KB
testcase_07 AC 23 ms
23,940 KB
testcase_08 AC 23 ms
23,940 KB
testcase_09 AC 25 ms
23,532 KB
testcase_10 AC 24 ms
23,808 KB
testcase_11 AC 24 ms
24,276 KB
testcase_12 AC 24 ms
23,292 KB
testcase_13 AC 27 ms
23,652 KB
testcase_14 AC 28 ms
24,288 KB
testcase_15 AC 96 ms
23,616 KB
testcase_16 AC 40 ms
23,448 KB
testcase_17 AC 58 ms
24,168 KB
testcase_18 AC 59 ms
23,496 KB
testcase_19 AC 114 ms
24,156 KB
testcase_20 AC 191 ms
24,240 KB
testcase_21 AC 211 ms
23,664 KB
testcase_22 AC 288 ms
23,412 KB
testcase_23 AC 291 ms
24,240 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     @hamayanhamayan
    /   \     | |
    /   / ̄ ̄ ̄ ̄/  |
  __(__ニつ/     _/ .| .|____
     \/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/














int N;
//---------------------------------------------------------------------------------------------------
int ask(int without) {
	int M = N - 1;
	vector<int> v;
	rep(i, 1, N + 1) if (i != without) v.push_back(i);
	printf("? %d\n", M);
	rep(i, 0, M) {
		if (i) printf(" ");
		printf("%d", v[i]);
	}
	printf("\n");
	fflush(stdout);

	int ans; cin >> ans;
	return ans;
}
void answer(vector<int> ans) {
	int K = ans.size();
	printf("! %d\n", K);
	rep(i, 0, K) {
		if (i) printf(" ");
		printf("%d", ans[i]);
	}
	printf("\n");
	fflush(stdout);
}
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N;
	vector<int> ans;
	rep(i, 1, N + 1) {
		auto res = ask(i);
		if (res == 0) ans.push_back(i);
	}
	answer(ans);
}





0