Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

const int COL = 64;
template<int MAX_COL>
struct BitMatrix {
    int N;
    vector<bitset<MAX_COL>> A;
    BitMatrix(int N) : N(N),A(N) {}

    int GaussJordan() {
        int rank = 0;
        for (int col = 0; col < MAX_COL; ++col) {
            int pivot = -1;
            for (int row = rank; row < H; ++row) {
                if (A[row][col]) {
                    pivot = row;
                    break;
                }
            }
            if (pivot == -1) continue;
            swap(A[pivot], A[rank]);
            for (int row = 0; row < H; ++row) {
                if (row != rank && A[row][col]) A[row] ^= A[rank];
            }
            ++rank;
        }
        return rank;
    }
};

using BM = BitMatrix<COL>; 

void solve() {
    int N; cin >> N;
    vector<u64> A(N);
    rep(i,N) cin >> A[i];
    reverse(all(A));
    string S; cin >> S;
    reverse(all(S));
    BM mat(N);
    rep(i,N) {
        if (S[i]=='1') {
            int MAX = mat.GaussJordan();
            int rank = 0;
            rep(bit,COL) {
                if ((A[i]>>bit)&1) {
                    while (rank < MAX) {
                        if (mat.A[rank][bit]) {
                            rep(j,COL) {
                                if (mat.A[rank][j]) A[i] ^= (1ull<<j);
                            }
                            rank++;
                            break;
                        }
                        rank++;
                    }
                }
            }
            if (A[i]) {
                cout << 1 << ln;
                return;
            }
        } else {
            rep(bit,COL) {
                if ((A[i]>>bit)&1) {
                    mat.A[i][bit] = 1;
                }
            }
        }
    }

    cout << 0 << ln;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int Q; cin >> Q;
    while (Q--) {
        solve();
    }
}

Compiler output:
a.cc: In member function 'int BitMatrix<MAX_COL>::GaussJordan()':
a.cc:39:40: error: 'H' was not declared in this scope
   39 |             for (int row = rank; row < H; ++row) {
      |                                        ^
a.cc:47:37: error: 'H' was not declared in this scope
   47 |             for (int row = 0; row < H; ++row) {
      |                                     ^