Language: C

#include <ctype.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")

//char rbuf[]; int rbufl;
//#define getchar() rbuf[rbufl++]
#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
void printint(int32_t x){ if(x<0){x=-x; putchar('-');}else if(x==0){putchar('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar(s[i]); putchar('\n'); }
void rsorta_d32(void *base, const int count, const int size, const int index){
	typedef int32_t rsort_t;
	rsort_t (*a)[size] = (rsort_t(*)[size])base;
	rsort_t (*b)[size] = (rsort_t(*)[size])malloc(count*size*sizeof(rsort_t));
	int c[0x100];
	for(int k=0; k<4; k++){
		memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[(a[i][index]>>(k<<3))&0xFF]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ int to=--c[(a[i][index]>>(k<<3))&0xFF]; for(int j=0; j<size; j++){ b[to][j]=a[i][j]; } }{rsort_t(*t)[size]=a; a=b; b=t;}
	}
	free(b);
}

long a[200];
char s[201];
std::set<long> d;
int main(void){
	int t=nextint();
	while(t-->0){
		int n=nextint();
		for(int i=0; i<n; i++){
			a[i]=nextlong();
		}
		nextstr(s);
		d.clear();
		d.insert(0);
		for(int i=n-1; i>=0; i--){
			if(s[i]=='0'){
				std::set<long> e=d;
				for(long x: e){
					d.insert(x^a[i]);
				}
			}else if(!(d.find(a[i])!=d.end())){
				d.clear();
			}
		}
		putchar((d.find(0)!=d.end())?'0':'1');
		putchar(10);
	}
}


Compiler output:
main.c:43:4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '::' token
   43 | std::set<long> d;
      |    ^~
main.c: In function 'main':
main.c:52:17: error: 'd' undeclared (first use in this function)
   52 |                 d.clear();
      |                 ^
main.c:52:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:56:33: error: 'std' undeclared (first use in this function)
   56 |                                 std::set<long> e=d;
      |                                 ^~~
main.c:56:36: error: expected ';' before '::' token
   56 |                                 std::set<long> e=d;
      |                                    ^~
      |                                    ;
main.c:57:43: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
   57 |                                 for(long x: e){
      |                                           ^
main.c:58:50: error: 'x' undeclared (first use in this function)
   58 |                                         d.insert(x^a[i]);
      |                                                  ^