Language: C++

include <bits/stdc++.h>
using namespace std;

set<int> S;
int A[202], B[202];
vector< pair<int, int> > Z;

int main() {

    int N;
    cin >> N;

    srand(time(0));

    vector<int> X;

    for(int i=0; i<2*N; i++)
        X.push_back(i+1);

    int x = 239;

    while(x--)
        random_shuffle(X.begin(), X.end());

    for(int test=1; test<=210; test++)
    {
        cout << "? ";

        S.clear();
        random_shuffle(X.begin(), X.end());

        for(int i=0; i<N; i++)
            S.insert(X[i]);

        for(auto s : S)
            cout << s << " ";
          cout << "\n";
        
        fflush(stdout);

        string res;
        cin >> res;

        for(int i=1; i<=2*N; i++)
        {
            int x = (res == "Red" ? 1 : -1);

            if(S.find(i) != S.end())
                A[i] += x;
            else
                A[i] -= x;
        }
    }

    cout << "! ";

    for(int i=1; i<=2*N; i++)
        Z.push_back({A[i], i});
    
    sort(Z.begin(), Z.end());
    reverse(Z.begin(), Z.end());

    for(int i=0; i<N; i++)
        B[ Z[i].second ] = 1;
    
    for(int i=1; i<=2*N; i++)
        cout << (B[i] > 0 ? 'R' : 'B');
    cout << "\n";

    fflush(stdout);

    return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc:4:1: error: 'set' does not name a type
    4 | set<int> S;
      | ^~~
a.cc:6:1: error: 'vector' does not name a type
    6 | vector< pair<int, int> > Z;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:11:5: error: 'cin' was not declared in this scope
   11 |     cin >> N;
      |     ^~~
a.cc:13:11: error: 'time' was not declared in this scope
   13 |     srand(time(0));
      |           ^~~~
a.cc:1:1: note: 'time' is defined in header '<ctime>'; this is probably fixable by adding '#include <ctime>'
  +++ |+#include <ctime>
    1 | include <bits/stdc++.h>
a.cc:13:5: error: 'srand' was not declared in this scope
   13 |     srand(time(0));
      |     ^~~~~
a.cc:15:5: error: 'vector' was not declared in this scope
   15 |     vector<int> X;
      |     ^~~~~~
a.cc:15:12: error: expected primary-expression before 'int'
   15 |     vector<int> X;
      |            ^~~
a.cc:18:9: error: 'X' was not declared in this scope
   18 |         X.push_back(i+1);
      |         ^
a.cc:23:24: error: 'X' was not declared in this scope
   23 |         random_shuffle(X.begin(), X.end());
      |                        ^
a.cc:23:9: error: 'random_shuffle' was not declared in this scope
   23 |         random_shuffle(X.begin(), X.end());
      |         ^~~~~~~~~~~~~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout << "? ";
      |         ^~~~
a.cc:29:9: error: 'S' was not declared in this scope
   29 |         S.clear();
      |         ^
a.cc:30:24: error: 'X' was not declared in this scope
   30 |         random_shuffle(X.begin(), X.end());
      |                        ^
a.cc:30:9: error: 'random_shuffle' was not declared in this scope
   30 |         random_shuffle(X.begin(), X.end());
      |         ^~~~~~~~~~~~~~
a.cc:39:16: error: 'stdout' was not declared in this scope
   39 |         fflush(stdout);
      |                ^~~~~~
a.cc:1:1: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <bits/stdc++.h>
a.cc:39:9: error: 'fflush' was not declared in this scope
   39 |         fflush(stdout);
      |         ^~~~~~
a.cc:41:9: error: 'string' was not declared in this scope
   41 |         string res;
      |         ^~~~~~
a.cc:42:16: error: 'res' was not declared in this scope
   42 |         cin >> res;
      |                ^~~
a.cc:55:5: error: 'cout' was not declared in this scope
   55 |     cout << "! ";
      |     ^~~~
a.cc:58:9: error: 'Z' was not declared in this scope
   58 |         Z.push_back({A[i], i});
      |         ^
a.cc:60:10: error: 'Z' was not declared in this scope
   60 |     sort(Z.begin(), Z.end());
      |          ^
a.cc:60:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   60 |     sort(Z.begin(), Z.end());
      |     ^~~~
      |     short
a.cc:61:5: error: 'reverse' was not declared in this scope
   61 |     reverse(Z.begin(), Z.end());
      |     ^~~~~~~
a.cc:70:12: error: 'stdout' was not declared in this scope
   70 |     fflush(stdout);
      |            ^~~~~~
a.cc:70:12: note: 'stdout' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:70:5: error: 'fflush' was not declared in this scope
   70 |     fflush(stdout);
      |     ^~~~~~