Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set> 
#include<cmath>
using namespace std;
//long long p = 998244353;
long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)-h.begin()
#define upper(h,val) upper_bound(h.begin(),h.end(),val)-h.begin()
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) { pa[x] = y; }
}
#define Yes "Yay!"
#define No ":("
int gcd(int x, int y) {
	if (x < y) { return gcd(y, x); }
	if (y == 0) { return x; }
	return gcd(y, x%y);
}
int solve(int x, int y) {
	int ans = rui(2, x) + rui(2, y)+p-1;
	ans %= p;
	int g1 = gcd(x, y);
	ans += rui(2, g1) + p - 2;
	ans %= p;
	return ans;
}
string pr(veb &a) {
	int n = a.size();
	cout << "?";
	rep(i, n) {
		if (a[i]) {
			cout << " " << i + 1;
		}
	}
	cout << flush;
	string ans; cin >> ans;
	return ans;
}
int n;
veb mak(int x) {
	veb ans(2*n,false);
	rep(i, n) { 
		if (i < x) {
			ans[i] = true;
		}
		else { ans[n + i - x] = true; }
	}
	return ans;
}
signed main() {
	cin >> n;
	veb ask(2*n,false);
	rep(i, n) { ask[i] = true; }
	veb ans(2 * n);
	string st = pr(ask);
	string now = st;
	int count = 0;
	int r = n;
	int l = 0;
	while (r-l>1) {
		int mid = (r + l) / 2;
		ask = mak(mid);
		string res = pr(ask);
		if (res == st) { r = mid; }
		else { l = mid; }
	}
	int count = n - r;
	ask = mak(r);
	int r1 = n - count;
	int b1 = n + count - 1;
	ans[r1] = true;
	ans[b1] = false;
	rep(i, 2 * n) {
		if (ask[i]) {
			ask[i] = false;
			ask[r1] = true;
			string tmp = pr(ask);
			if (tmp == now) {
				ans[i] = ans[r1];
			}
			else { ans[i] = !ans[r1]; }
			ask[i] = true;
			ask[r1] = false;
		}
		else {
			ask[i] = true;
			ask[b1] = false;
			string tmp = pr(ask);
			if (tmp == now) {
				ans[i] = ans[b1];
			}
			else { ans[i] = !ans[b1]; }
			ask[i] = false;
			ask[b1] = true;
		}
	}
	cout << "!" << " ";
	rep(i, 2 * n) {
		if (ans[i]) { cout << st[0]; }
		else { cout << now[0]; }
	}
	cout << flush;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:119:13: error: redeclaration of 'long long int count'
  119 |         int count = n - r;
      |             ^~~~~
a.cc:109:13: note: 'long long int count' previously declared here
  109 |         int count = 0;
      |             ^~~~~