Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <iomanip>
#include <map>
#include <set>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <iterator>
#include <string>
#include <limits>

using namespace std;

using i64 = int64_t;
using P = pair<i64, i64>;
//i64 mod = 1000000007;
i64 mod = 998244353;
int int_max = 2147483647;
i64 INF = 1e16;
int max_n = 1e5;

int main(int argc, char **argv) {
    i64 t;
    cin >> t;

    for (int ti=0; ti<t; ++ti) {
        i64 n;
        cin >> n;
        std::vector<i64> a(n);
        for (int i=0; i<n; ++i) {
            cin >> a[i];
        }
        string s;
        cin >> s;
        std::unordered_set<i64> w;
        dp[n].insert(0);

        for (int i=n-1; i >= 0; --i) {
            std::set<i64> w_new = w;
            if (s[i] == '0') {
                for (auto v : w)
                    w_new.insert(a[i] ^ v);
            } else {
                auto it = w.find(a[i]);
                if (it == w.end()) {
                    w_new = std::set<i64>();
                }
            }
            w = std::move(w_new);
        }
        cout << (w.empty() ? '1' : '0') << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:40:9: error: 'dp' was not declared in this scope
   40 |         dp[n].insert(0);
      |         ^~
a.cc:43:35: error: conversion from 'std::unordered_set<long int>' to non-scalar type 'std::set<long int>' requested
   43 |             std::set<i64> w_new = w;
      |                                   ^
a.cc:53:32: error: no match for 'operator=' (operand types are 'std::unordered_set<long int>' and 'std::remove_reference<std::set<long int>&>::type' {aka 'std::set<long int>'})
   53 |             w = std::move(w_new);
      |                                ^
In file included from /usr/include/c++/14/unordered_set:41,
                 from a.cc:11:
/usr/include/c++/14/bits/unordered_set.h:273:7: note: candidate: 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>& std::unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(const std::unordered_set<_Value, _Hash, _Pred, _Alloc>&) [with _Value = long int; _Hash = std::hash<long int>; _Pred = std::equal_to<long int>; _Alloc = std::allocator<long int>]'
  273 |       operator=(const unordered_set&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_set.h:273:17: note:   no known conversion for argument 1 from 'std::remove_reference<std::set<long int>&>::type' {aka 'std::set<long int>'} to 'const std::unordered_set<long int>&'
  273 |       operator=(const unordered_set&) = default;
      |                 ^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_set.h:277:7: note: candidate: 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>& std::unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(std::unordered_set<_Value, _Hash, _Pred, _Alloc>&&) [with _Value = long int; _Hash = std::hash<long int>; _Pred = std::equal_to<long int>; _Alloc = std::allocator<long int>]'
  277 |       operator=(unordered_set&&) = default;
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_set.h:277:17: note:   no known conversion for argument 1 from 'std::remove_reference<std::set<long int>&>::type' {aka 'std::set<long int>'} to 'std::unordered_set<long int>&&'
  277 |       operator=(unordered_set&&) = default;
      |                 ^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/unordered_set.h:291:7: note: candidate: 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>& std::unordered_set<_Value, _Hash, _Pred, _Alloc>::operator=(std::initializer_list<typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::value_type>) [with _Value = long int; _Hash = std::hash<long int>; _Pred = std::equal_to<long int>; _Alloc = std::allocator<long int>; typename std::_Hashtable<_Value, _Value, _Alloc, std::__detail::_Identity, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__is_nothrow_invocable<const _Hash&, const _Tp&> > >::value, true, true> >::value_type = long int]'
  291 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/unordered_set.h:291:46: note:   no known conversion for argument 1 from 'std::remove_reference<std::set<long int>&>::type' {aka 'std::set<long int>'} to 'std::initializer_list<long int>'
  291 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~