Language: C++

//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
const int N=505;
char s[5];int a[N],col[N],st[N],cnt[2],top,n,las,now,ql,qr;
R int cnt=0;
inline int ask(R int l,R int r){
	assert(cnt++<210);
	putchar('?'),putchar(' ');
	fp(i,l,r)printf("%d ",i);
	putchar('\n'),fflush(stdout);
	scanf("%s",s+1);return s[1]=='R';
}
inline int ask(R int x){
	assert(cnt++<210);
	putchar('?'),putchar(' ');
	fp(i,1,top)printf("%d ",st[i]);
	printf("%d\n",x),fflush(stdout);
	scanf("%s",s+1);return s[1]=='R';
}
int main(){
	scanf("%d",&n);
	fp(i,1,n<<1)col[i]=-1;
	las=ask(1,n);
	fp(i,2,n+1){
		now=ask(i,i+n-1);
		if(now^las){
			col[i-1]=las,col[i+n-1]=now;
			fp(k,i,i+n-2)st[++top]=k;
			fp(k,1,i-2)col[k]=ask(k);
			fp(k,i+n,n<<1)col[k]=ask(k);
			ql=i,qr=i+n-2;
			break;
		}
		las=now;
	}
	top=0;
	fp(i,1,n<<1)if((~col[i])&&cnt[col[i]]+1<=((n-1)>>1))
		st[++top]=i,++cnt[col[i]];
	fp(i,ql,qr)col[i]=ask(i);
	putchar('!'),putchar(' ');
	fp(i,1,n<<1)putchar(col[i]?'R':'B');
	putchar('\n'),fflush(stdout);
	return 0;
}

Compiler output:
a.cc:12:7: error: conflicting declaration 'int cnt'
   12 | R int cnt=0;
      |       ^~~
a.cc:11:33: note: previous declaration as 'int cnt [2]'
   11 | char s[5];int a[N],col[N],st[N],cnt[2],top,n,las,now,ql,qr;
      |                                 ^~~
a.cc:13:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 | inline int ask(R int l,R int r){
      |                      ^
a.cc:13:30: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   13 | inline int ask(R int l,R int r){
      |                              ^
In file included from /usr/include/c++/14/cassert:44,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:106,
                 from a.cc:2:
a.cc: In function 'int ask(int, int)':
a.cc:14:16: error: lvalue required as increment operand
   14 |         assert(cnt++<210);
      |                ^~~
a.cc:16:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   16 |         fp(i,l,r)printf("%d ",i);
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:16:9: note: in expansion of macro 'fp'
   16 |         fp(i,l,r)printf("%d ",i);
      |         ^~
a.cc: At global scope:
a.cc:20:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   20 | inline int ask(R int x){
      |                      ^
a.cc: In function 'int ask(int)':
a.cc:21:16: error: lvalue required as increment operand
   21 |         assert(cnt++<210);
      |                ^~~
a.cc:23:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   23 |         fp(i,1,top)printf("%d ",st[i]);
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:23:9: note: in expansion of macro 'fp'
   23 |         fp(i,1,top)printf("%d ",st[i]);
      |         ^~
a.cc: In function 'int main()':
a.cc:29:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   29 |         fp(i,1,n<<1)col[i]=-1;
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:29:9: note: in expansion of macro 'fp'
   29 |         fp(i,1,n<<1)col[i]=-1;
      |         ^~
a.cc:31:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   31 |         fp(i,2,n+1){
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:31:9: note: in expansion of macro 'fp'
   31 |         fp(i,2,n+1){
      |         ^~
a.cc:35:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   35 |                         fp(k,i,i+n-2)st[++top]=k;
      |                            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:35:25: note: in expansion of macro 'fp'
   35 |                         fp(k,i,i+n-2)st[++top]=k;
      |                         ^~
a.cc:36:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   36 |                         fp(k,1,i-2)col[k]=ask(k);
      |                            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:36:25: note: in expansion of macro 'fp'
   36 |                         fp(k,1,i-2)col[k]=ask(k);
      |                         ^~
a.cc:37:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   37 |                         fp(k,i+n,n<<1)col[k]=ask(k);
      |                            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:37:25: note: in expansion of macro 'fp'
   37 |                         fp(k,i+n,n<<1)col[k]=ask(k);
      |                         ^~
a.cc:44:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   44 |         fp(i,1,n<<1)if((~col[i])&&cnt[col[i]]+1<=((n-1)>>1))
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:44:9: note: in expansion of macro 'fp'
   44 |         fp(i,1,n<<1)if((~col[i])&&cnt[col[i]]+1<=((n-1)>>1))
      |         ^~
a.cc:46:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   46 |         fp(i,ql,qr)col[i]=ask(i);
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:46:9: note: in expansion of macro 'fp'
   46 |         fp(i,ql,qr)col[i]=ask(i);
      |         ^~
a.cc:48:12: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   48 |         fp(i,1,n<<1)putchar(col[i]?'R':'B');
      |            ^
a.cc:4:29: note: in definition of macro 'fp'
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                             ^
a.cc:4:35: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    4 | #define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
      |                                   ^
a.cc:48:9: note: in expansion of macro 'fp'
   48 |         fp(i,1,n<<1)putchar(col[i]?'R':'B');
      |         ^~