Language: C++

// https://atcoder.jp/contests/agc045/tasks/agc045_a
#define CIN_ONLY
#define DECIMAL_DIGITS 10
#define STATIC_MOD 1e9 + 7

#ifdef BTK
/*<head>*/
#    include "Template.hpp"
/*</head>*/
#else
/*<body>*/
/*</body>*/
#endif
int N;
string S;

int x[61];
bool vis0[62][4];
bool vis1[62][4];
bool memo0[62][4];
bool memo1[62][4];


bool t0(int p, int cur);
bool t1(int p, int cur);

bool t0(int p, int cur) {
    if (vis0[p][cur]) {
        return memo0[p][cur];
    }
    vis0[p][cur] = true;
    auto& memo   = memo0[p][cur];
    memo         = false;
    for (int a : {0, x[p]}) {
        int nxt = cur ^ a;
        if (p == N) {
            memo |= nxt == 0;
        }
        else {
            if (S[p] == '0') {
                memo |= t0(p + 1, nxt);
            }
            else {
                memo |= !t1(p + 1, nxt);
            }
        }
    }
    return memo;
}
bool t1(int p, int cur) {
    if (vis1[p][cur]) {
        return memo1[p][cur];
    }
    vis1[p][cur] = true;
    auto& memo   = memo1[p][cur];
    memo         = false;
    for (int a : {0, x[p]}) {
        int nxt = cur ^ a;
        if (p == N) {
            memo |= nxt != 0;
        }
        else {
            if (S[p] == '0') {
                memo |= !t0(p + 1, nxt);
            }
            else {
                memo |= t1(p + 1, nxt);
            }
        }
    }
    return memo;
}


void solve() {
    cin >> N;
    vector<LL> A(N);
    cin >> A;
    cin >> S;
    bool win = true;
    for (int i : range(60)) {
        for (int j : range(i + 1, 60)) {
            x[0] = 0;
            for (int k : range(N)) {
                x[k + 1] = ((A[k] >> i) & 1) + (((A[k] >> j) & 1) << 1);
            }
            for (int k : range(N + 1)) {
                for (int l : range(4)) {
                    vis0[k][l] = false;
                    vis1[k][l] = false;
                }
            }
            bool r = t0(0, 0);
            win    = win & r;
        }
    }
    if (win) {
        cout << "0" << endl;
    }
    else {
        cout << "1" << endl;
    }
}
int main() {
    /* write here */
    int T;
    cin >> T;
    for (int i : range(T)) {
        solve();
    }
    return 0;
}

Compiler output:
a.cc:15:1: error: 'string' does not name a type
   15 | string S;
      | ^~~~~~
a.cc: In function 'bool t0(int, int)':
a.cc:34:26: error: deducing from brace-enclosed initializer list requires '#include <initializer_list>'
  +++ |+#include <initializer_list>
    1 | // https://atcoder.jp/contests/agc045/tasks/agc045_a
......
   34 |     for (int a : {0, x[p]}) {
      |                          ^
a.cc:40:17: error: 'S' was not declared in this scope
   40 |             if (S[p] == '0') {
      |                 ^
a.cc: In function 'bool t1(int, int)':
a.cc:57:26: error: deducing from brace-enclosed initializer list requires '#include <initializer_list>'
   57 |     for (int a : {0, x[p]}) {
      |                          ^
a.cc:63:17: error: 'S' was not declared in this scope
   63 |             if (S[p] == '0') {
      |                 ^
a.cc: In function 'void solve()':
a.cc:76:5: error: 'cin' was not declared in this scope
   76 |     cin >> N;
      |     ^~~
a.cc:77:5: error: 'vector' was not declared in this scope
   77 |     vector<LL> A(N);
      |     ^~~~~~
a.cc:77:12: error: 'LL' was not declared in this scope
   77 |     vector<LL> A(N);
      |            ^~
a.cc:77:16: error: 'A' was not declared in this scope
   77 |     vector<LL> A(N);
      |                ^
a.cc:79:12: error: 'S' was not declared in this scope
   79 |     cin >> S;
      |            ^
a.cc:81:18: error: 'range' was not declared in this scope
   81 |     for (int i : range(60)) {
      |                  ^~~~~
a.cc:98:9: error: 'cout' was not declared in this scope
   98 |         cout << "0" << endl;
      |         ^~~~
a.cc:98:24: error: 'endl' was not declared in this scope
   98 |         cout << "0" << endl;
      |                        ^~~~
a.cc:101:9: error: 'cout' was not declared in this scope
  101 |         cout << "1" << endl;
      |         ^~~~
a.cc:101:24: error: 'endl' was not declared in this scope
  101 |         cout << "1" << endl;
      |                        ^~~~
a.cc: In function 'int main()':
a.cc:107:5: error: 'cin' was not declared in this scope
  107 |     cin >> T;
      |     ^~~
a.cc:108:18: error: 'range' was not declared in this scope
  108 |     for (int i : range(T)) {
      |                  ^~~~~