Language: C++

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<cassert>

#include<cmath>
#include<functional>
#include<algorithm>

#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<bitset>
#include<tuple>

#define TEST {IS_TEST=true;}

using namespace std;
using ll = int_fast64_t;
using v_bool = vector <bool>;
using v_ll = vector <ll>;
using v_std = vector <string>;
using p_ll = pair <ll,ll>;
using vv_ll = vector <vector <ll> >;
using vp_ll = vector < p_ll >;

using ld = long double;
using v_ld = vector <ld>;
using vv_ld = vector<v_ld>;

bool IS_TEST=false;
ll ll_min=1LL<<63;
ll ll_max=~ll_min;
ll int_min=1LL<<31;
ll int_max=~ll_max;
ll MOD = 1000000007;

template<class T>
void show(const T &x){
  if (!IS_TEST) return;
  cout << x << endl;
}
template<class T1,class T2>
void show(const pair<T1,T2> &x){
  if (!IS_TEST) return;
  cout << "{" << x.first << "," << x.second << "}" << endl;
}

template<class T>
void show_sub(const T &x){if (!IS_TEST) return; cout << x;}
void show_sub(const string &x){if (!IS_TEST) return; cout << x << endl;}
template<class T1,class T2>
void show_sub(const pair<T1,T2> &x){
  if (!IS_TEST) return;
  cout << "{" << show_sub(x.first) << "," << show_sub(x.second) << "}";
}
template<class T>
void v_show(const T &v){
  if (!IS_TEST) return;
  auto itr=v.begin();
  while(itr!=v.end()){ show_sub(*itr); itr++;}
  cout << endl;
}

template<class T>
void vv_show(const T &v){
  if (!IS_TEST) return;
  cout << "--------------------------------\n";
  auto itr=v.begin();
  while(itr!=v.end()){ v_show(*itr); itr++;}
  cout << "--------------------------------" << endl;
}



ll max(ll x,ll y){return x>y?x:y;}
ll max(ll x,ll y, ll z){return max(max(x,y),z);}
ll max(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) {ans=max(ans,*b);b++;}
    return ans;
}
ll min(ll x,ll y){return x<y?x:y;}
ll min(ll x,ll y, ll z){return min(min(x,y),z);}
ll min(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) {ans=min(ans,*b);b++;}
    return ans;
}
ll mid(ll x,ll y,ll z){
    if (y>=x && x>=z) return x;
    if (z>=x && x>=y) return x;
    if (x>=y && y>=z) return y;
    if (z>=y && y>=x) return y;
    if (x>=z && z>=y) return z;
    if (y>=z && z>=x) return z;
    return x;
}
ll gcd(ll x,ll y){
    if(x<0)x=-x; if(y<0)y=-y;
    while(y>0){ x%=y; swap(x,y); }
    return x;
}
ll gcd(ll x,ll y, ll z){return gcd(gcd(x,y),z);}
ll gcd(v_ll::iterator b,v_ll::iterator e){
    ll ans=0;
    while (b<e) ans=gcd(ans,*b);
    return ans;
}
ll lcm(ll x,ll y){
    ll z=x*y; if(x<0)x=-x; if(y<0)y=-y;
    while(y>0){ x%=y; swap(x,y); }
    return z/x;
}
ll lcm(ll x,ll y, ll z){return lcm(lcm(x,y),z);}
ll lcm(v_ll::iterator b,v_ll::iterator e){
    ll ans=1;
    while (b<e) ans=lcm(ans,*b);
    return ans;
}

v_ll arange(ll n){
    v_ll v(n+1,0);
    for(ll i=0;i<=n;i++)v[i]=i;
    return v;
}

ll vec_sum(const v_ll& v,ll b,ll e){
    ll ans=0;
    for(ll i=b;i<e;i++)ans+=v[i];
    return ans;
}
ll v_sum(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans+=*b; b++;}
    return ans;
}
ll v_xor(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans^=*b; b++;}
    return ans;
}
ll v_eq(v_ll::iterator b,v_ll::iterator e){
    ll ans=*b;
    while (b<e) { ans^=~*b; b++;}
    return ans;
}


template<class T> void refl_max(T& x,const T& y){ if (x>=y) return; x=y; }
template<class T> void refl_min(T& x,const T& y){ if (x<=y) return; x=y; }

template<class T,class S> void refl_max(T& x,S& xx,const T& y,const S& yy){
  if (x>=y) return; x=y; xx=yy;
}
template<class T,class S> void refl_min(T& x,S& xx,const T& y,const S& yy){
  if (x<=y) return; x=y; xx=yy;
}

template<class T> void quit(T x){cout << x << endl; exit(0);}

/*O(logN)*/
ll sqrt_ll(ll n){
  assert(n>=0);
  ll ok = 0,ng = n+1;
  while(ok-ng>1||ng-ok>1){ ll m=(ok+ng)/2; if (m*m<=n) ok=m; else ng=m;}
  return ok;
}

ll N;
v_ll A;
int main(){
  cin >> N;
  
  ll ok=1,ng=1+N;
  string firstans="";
  cout << "?";
  for (ll i=1;i<=N;i++){
    cout << " " << i;
  };

  cout << endl;
  fflush(stdout);
  cin >> firstans;
  while(abs(ok-ng)>1){ 
    ll m=(ok+ng)/2;
    cout << "?";
    for (ll i=0;i<N;i++){
      cout << " " << m+i;
    };
    cout << endl;
    fflush(stdout);
    string x;
    cin >> x;
    if (x=="-1")exit(0);
    if (x==firstans)ok=m ; else ng=m;
  }
  vector<char> ans(N*2+2,0);
  for (ll i=1;i<=2*N;i++){
    if (ng<=i && i<ng+N){
      cout << "?";
      for (ll i=0;i<N-1;i++){
        cout << " " << (ng+N)%(2*N)+i;
      };
      cout << " " << i << endl;
      string x;
      cin >> x;
      if (x=="Red")ans[i]='R';
      else ans[i]='B';
    }else{
      cout << "?";
      for (ll i=0;i<N-1;i++){
        cout << " " << ng+i;
      };
      string x;
      cin >> x;
      if (x=="Red")ans[i]='R';
      else ans[i]='B';
    }
  }
  ans[0]='!';
  ans[2*N+1]='\0';
  printf("%s\n",ans);
}




Compiler output:
a.cc:25:12: error: 'int_fast64_t' does not name a type
   25 | using ll = int_fast64_t;
      |            ^~~~~~~~~~~~
a.cc:27:22: error: 'll' was not declared in this scope
   27 | using v_ll = vector <ll>;
      |                      ^~
a.cc:27:24: error: template argument 1 is invalid
   27 | using v_ll = vector <ll>;
      |                        ^
a.cc:27:24: error: template argument 2 is invalid
a.cc:29:20: error: 'll' was not declared in this scope
   29 | using p_ll = pair <ll,ll>;
      |                    ^~
a.cc:29:23: error: 'll' was not declared in this scope
   29 | using p_ll = pair <ll,ll>;
      |                       ^~
a.cc:29:25: error: template argument 1 is invalid
   29 | using p_ll = pair <ll,ll>;
      |                         ^
a.cc:29:25: error: template argument 2 is invalid
a.cc:30:31: error: 'll' was not declared in this scope
   30 | using vv_ll = vector <vector <ll> >;
      |                               ^~
a.cc:30:33: error: template argument 1 is invalid
   30 | using vv_ll = vector <vector <ll> >;
      |                                 ^
a.cc:30:33: error: template argument 2 is invalid
a.cc:30:35: error: template argument 1 is invalid
   30 | using vv_ll = vector <vector <ll> >;
      |                                   ^
a.cc:30:35: error: template argument 2 is invalid
a.cc:31:24: error: 'p_ll' was not declared in this scope
   31 | using vp_ll = vector < p_ll >;
      |                        ^~~~
a.cc:31:29: error: template argument 1 is invalid
   31 | using vp_ll = vector < p_ll >;
      |                             ^
a.cc:31:29: error: template argument 2 is invalid
a.cc:38:1: error: 'll' does not name a type; did you mean 'ld'?
   38 | ll ll_min=1LL<<63;
      | ^~
      | ld
a.cc:39:1: error: 'll' does not name a type; did you mean 'ld'?
   39 | ll ll_max=~ll_min;
      | ^~
      | ld
a.cc:40:1: error: 'll' does not name a type; did you mean 'ld'?
   40 | ll int_min=1LL<<31;
      | ^~
      | ld
a.cc:41:1: error: 'll' does not name a type; did you mean 'ld'?
   41 | ll int_max=~ll_max;
      | ^~
      | ld
a.cc:42:1: error: 'll' does not name a type; did you mean 'ld'?
   42 | ll MOD = 1000000007;
      | ^~
      | ld
a.cc:82:1: error: 'll' does not name a type; did you mean 'ld'?
   82 | ll max(ll x,ll y){return x>y?x:y;}
      | ^~
      | ld
a.cc:83:1: error: 'll' does not name a type; did you mean 'ld'?
   83 | ll max(ll x,ll y, ll z){return max(max(x,y),z);}
      | ^~
      | ld
a.cc:84:1: error: 'll' does not name a type; did you mean 'ld'?
   84 | ll max(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:89:1: error: 'll' does not name a type; did you mean 'ld'?
   89 | ll min(ll x,ll y){return x<y?x:y;}
      | ^~
      | ld
a.cc:90:1: error: 'll' does not name a type; did you mean 'ld'?
   90 | ll min(ll x,ll y, ll z){return min(min(x,y),z);}
      | ^~
      | ld
a.cc:91:1: error: 'll' does not name a type; did you mean 'ld'?
   91 | ll min(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:96:1: error: 'll' does not name a type; did you mean 'ld'?
   96 | ll mid(ll x,ll y,ll z){
      | ^~
      | ld
a.cc:105:1: error: 'll' does not name a type; did you mean 'ld'?
  105 | ll gcd(ll x,ll y){
      | ^~
      | ld
a.cc:110:1: error: 'll' does not name a type; did you mean 'ld'?
  110 | ll gcd(ll x,ll y, ll z){return gcd(gcd(x,y),z);}
      | ^~
      | ld
a.cc:111:1: error: 'll' does not name a type; did you mean 'ld'?
  111 | ll gcd(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:116:1: error: 'll' does not name a type; did you mean 'ld'?
  116 | ll lcm(ll x,ll y){
      | ^~
      | ld
a.cc:121:1: error: 'll' does not name a type; did you mean 'ld'?
  121 | ll lcm(ll x,ll y, ll z){return lcm(lcm(x,y),z);}
      | ^~
      | ld
a.cc:122:1: error: 'll' does not name a type; did you mean 'ld'?
  122 | ll lcm(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:128:1: error: 'v_ll' does not name a type; did you mean 'v_ld'?
  128 | v_ll arange(ll n){
      | ^~~~
      | v_ld
a.cc:134:1: error: 'll' does not name a type; did you mean 'ld'?
  134 | ll vec_sum(const v_ll& v,ll b,ll e){
      | ^~
      | ld
a.cc:139:1: error: 'll' does not name a type; did you mean 'ld'?
  139 | ll v_sum(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:144:1: error: 'll' does not name a type; did you mean 'ld'?
  144 | ll v_xor(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:149:1: error: 'll' does not name a type; did you mean 'ld'?
  149 | ll v_eq(v_ll::iterator b,v_ll::iterator e){
      | ^~
      | ld
a.cc:169:1: error: 'll' does not name a type; did you mean 'ld'?
  169 | ll sqrt_ll(ll n){
      | ^~
      | ld
a.cc:176:1: error: 'll' does not name a type; did you mean 'ld'?
  176 | ll N;
      | ^~
      | ld
a.cc:177:1: error: 'v_ll' does not name a type; did you mean 'v_ld'?
  177 | v_ll A;
      | ^~~~
      | v_ld
a.cc: In function 'int main()':
a.cc:179:10: error: 'N' was not declared in this scope
  179 |   cin >> N;
      |          ^
a.cc:181:3: error: 'll' was not declared in this scope; did you mean 'ld'?
  181 |   ll ok=1,ng=1+N;
      |   ^~
      |   ld
a.cc:184:10: error: expected ';' before 'i'
  184 |   for (ll i=1;i<=N;i++){
      |          ^~
      |          ;
a.cc:184:15: error: 'i' was not declared in this scope
  184 |   for (ll i=1;i<=N;i++){
      |               ^
a.cc:191:13: error: 'ok' was not declared in this scope
  191 |   while(abs(ok-ng)>1){
      |             ^~
a.cc:191:16: error: 'ng' was not declared in this scope
  191 |   while(abs(ok-ng)>1){
      |                ^~
a.cc:192:7: error: expected ';' before 'm'
  192 |     ll m=(ok+ng)/2;
      |       ^~
      |       ;
a.cc:194:12: error: expected ';' before 'i'
  194 |     for (ll i=0;i<N;i++){
      |            ^~
      |            ;
a.cc:194:17: error: 'i' was not declared in this scope
  194 |     for (ll i=0;i<N;i++){
      |                 ^
a.cc:195:22: error: 'm' was not declared in this scope; did you mean 'tm'?
  195 |       cout << " " << m+i;
      |                      ^
      |                      tm
a.cc:202:24: error: 'm' was not declared in this scope
  202 |     if (x==firstans)ok=m ; else ng=m;
      |                        ^
a.cc:202:36: error: 'm' was not declared in this scope
  202 |     if (x==firstans)ok=m ; else ng=m;
      |                                    ^
a.cc:205:10: error: expected ';' before 'i'
  205 |   for (ll i=1;i<=2*N;i++){
      |          ^~
      |          ;
a.cc:205:15: error: 'i' was not declared in this scope
  205 |   for (ll i=1;i<=2*N;i++){
      |               ^
a.cc:206:9: error: 'ng' was not declared in this scope
  206 |     if (ng<=i && i<ng+N){
      |         ^~
a.cc:208:14: error: expected ';' before 'i'
  208 |       for (ll i=0;i<N-1;i++){
      |              ^~
      |              ;
a.cc:218:14: error: expected ';' before 'i'
  218 |       for (ll i=0;i<N-1;i++){
      |              ^~
      |              ;