Language: C++

// Words are flowing out like endless rain into a paper cup
// They slither while they pass they slip away across the universe
// Pools of sorrow, waves of joy are drifting through my open mind
// Possessing and caressing me

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

using i64 = long long;

namespace _buff {

const size_t BUFF = 1 << 19;
char ibuf[BUFF], *ib = ibuf, *ie = ibuf;
char getc() {
    if (ib == ie) {
        ib = ibuf;
        ie = ibuf + fread(ibuf, 1, BUFF, stdin);
    }
    return ib == ie ? -1 : *ib++;
}

}

i64 read() {
    using namespace _buff;
    i64 ret = 0;
    bool pos = true;
    char c = getc();
    for (; (c < '0' || c > '9') && c != '-'; c = getc()) {
        assert(~c);
    }
    if (c == '-') {
        pos = false;
        c = getc();
    }
    for (; c >= '0' && c <= '9'; c = getc()) {
        ret = (ret << 3) + (ret << 1) + (c ^ 48);
    }
    return pos ? ret : -ret;
}

size_t reads(int *s) {
    using namespace _buff;
    size_t ret = 0;
    char c = getc();
    for (; c != '0' && c != '1'; c = getc()) {
        assert(~c);
    }
    for (; c == '0' || c == '1'; c = getc()) {
        s[ret++] = c ^ 48;
    }
    return ret;
}

using u64 = unsigned long long;

const size_t L = 60;

struct Basis {
    u64 b[L];

    Basis() {
        memset(b, 0, sizeof b);
    }

    void add(u64 x) {
        for (size_t i = L; i--; ) {
            if (x >> i & 1) {
                if (!b[i]) {
                    b[i] ^= x;
                    return;
                }
                x ^= b[i];
            }
        }
    }

    bool query(u64 x) {
        for (size_t i = L; i--; ) {
            if (x >> i & 1) {
                x ^= b[i];
            }
        }
        return !x;
    }
};

void add(Basis &b, u64 x) {
    static u64 bas[L];
    memcpy(bas, b.b, sizeof b.b);
    for (size_t i = 0; i < L; ++i) {
        b.add(bas[i] ^ x);
    }
}

const size_t N = 2E2 + 5;

u64 a[N]; int b[N];

void solve() {
    int n = read();
    generate_n(a, n, read);
    assert(n == (int) reads(b));
    reverse(a, a + n); reverse(b, b + n);
    Basis bas;
    for (int i = 0; i < n; ++i) {
        if (b[i]) {
            if (!bas.query(a[i])) {
                puts("1"); return;
            }
        } else {
            add(bas, a[i]);
        }
    }
    puts(bas.query(0) ? "0" : "1");
}

int main() {
    for (int t = read(); t--; ) {
        solve();
    }
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:103:15: error: no matching function for call to 'generate_n(u64 [205], int&, <unresolved overloaded function type>)'
  103 |     generate_n(a, n, read);
      |     ~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:6:
/usr/include/c++/14/bits/stl_algo.h:4378:5: note: candidate: 'template<class _OIter, class _Size, class _Generator> _OIter std::generate_n(_OIter, _Size, _Generator)'
 4378 |     generate_n(_OutputIterator __first, _Size __n, _Generator __gen)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4378:5: note:   template argument deduction/substitution failed:
a.cc:103:15: note:   couldn't deduce template parameter '_Generator'
  103 |     generate_n(a, n, read);
      |     ~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:204:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _Size, class _Generator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::generate_n(_ExecutionPolicy&&, _ForwardIterator, _Size, _Generator)'
  204 | generate_n(_ExecutionPolicy&& __exec, _ForwardIterator __first, _Size count, _Generator __g);
      | ^~~~~~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:204:1: note:   candidate expects 4 arguments, 3 provided