criyle/codenet-compile-errors huggingface dataset:
Language: C++

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

int main() {
  int x=0;
  int T;
  cin >> T;
  
  for(int i=0;i<T;i++){
    int N;
    cin >> N;
    vector<int> vec(N);
    
    for(int a=0;a<N;a++){
      cin >> vec.at(a);
    }
    
    string str;
    cin >> str;
    
    for(int a=0;a<N;a++){
      if(str.at(a)==1){    //1の人の時
        if(x=0){
          if(vec(a)==1){
            x=1;
          }
          else{
            x=0;
          }
        }
      }
      else{
        x=1;
      }
    }
    else{　　　　//0の人の時
      if(x==0){
      }
      else{
        if(vec(a)==1){
          x=0;
        }
        else{
          x=1;
        }
      }
    }
    cout << x;
  }
}


        
        

Compiler output:
a.cc:36:10: error: extended character 　 is not valid in an identifier
   36 |     else{　　　　//0の人の時
      |          ^
a.cc:36:10: error: extended character 　 is not valid in an identifier
a.cc:36:10: error: extended character 　 is not valid in an identifier
a.cc:36:10: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:24:17: error: no match for call to '(std::vector<int>) (int&)'
   24 |           if(vec(a)==1){
      |              ~~~^~~
a.cc:36:5: error: 'else' without a previous 'if'
   36 |     else{　　　　//0の人の時
      |     ^~~~
a.cc:36:10: error: '\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   36 |     else{　　　　//0の人の時
      |          ^~~~~~~~
a.cc:39:7: error: 'else' without a previous 'if'
   39 |       else{
      |       ^~~~
a.cc:40:16: error: 'a' was not declared in this scope
   40 |         if(vec(a)==1){
      |                ^
Language: C

#include<stdio.h>
#include<string.h>
#define N 200
#define T 100
int main()
{
  int t,n,x=0,k=0,i=0;
  long long int a[N];
  char s[N];
  scanf("%d",&t);
  while(scanf("%d",&n)!=EOF))
  {
    for(i=0;i<n;i++)
    {
      scanf("%lld ",&a[i]);
      if(a[i]%2==0)
      {
        a[i]=0;
      }
      else
      {
        a[i]=1;
      }
    }
    for(i=0;i<n;i++)
    {
      scanf("%c",&s[i]);
    }
    for(i=0;i<n;i++)
    {
      if(s[i]=='1')
      {
        x=1;
        k=x XOR a[i];
      }
      else 
      {
        k=x XOR a[i];
      }
    }
    printf("%d",k);
  }
  return 0;
}

  
    
  
  

Compiler output:
main.c: In function 'main':
main.c:11:29: error: expected statement before ')' token
   11 |   while(scanf("%d",&n)!=EOF))
      |                             ^
main.c:34:12: error: expected ';' before 'XOR'
   34 |         k=x XOR a[i];
      |            ^~~~
      |            ;
main.c:38:12: error: expected ';' before 'XOR'
   38 |         k=x XOR a[i];
      |            ^~~~
      |            ;
Language: C++

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

int main() {
  int x=0;
  int T;
  cin >> T;
  
  for(int i=0;i<T;i++){
    int N;
    cin >> N;
    vector<int> vec(N);
    
    for(int a=0;a<N;a++){
      cin >> vec.at(a);
    }
    
    string str;
    cin >> str;
    
    for(int a=0;a<N;a++){
      if(str.at(a)==1){    //1の人の時
        if(x=0){
          if(vec(a)==1){
            x=1;
          }
          else{
            x=1;
          }
        }
        else{
          x=1;
        }
      }
      else{　　　　//0の人の時
        if(x==0){
        }
        else{
          if(vec(a)==1){
            x=0;
          }
          else{
            x=1;
          }
        }
      }
      cout << x;
    }
  }
}

        
        

Compiler output:
a.cc:35:12: error: extended character 　 is not valid in an identifier
   35 |       else{　　　　//0の人の時
      |            ^
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:24:17: error: no match for call to '(std::vector<int>) (int&)'
   24 |           if(vec(a)==1){
      |              ~~~^~~
a.cc:35:12: error: '\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   35 |       else{　　　　//0の人の時
      |            ^~~~~~~~
a.cc:38:9: error: 'else' without a previous 'if'
   38 |         else{
      |         ^~~~
a.cc:39:17: error: no match for call to '(std::vector<int>) (int&)'
   39 |           if(vec(a)==1){
      |              ~~~^~~
Language: C++

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

int main() {
  int x=0;
  int T;
  cin >> T;
  
  for(int i=0;i<T;i++){
    int N;
    cin >> N;
    vector<int> vec(N);
    
    for(int a=0;a<N;a++){
      cin >> vec.at(a);
    }
    
    string str;
    cin >> str;
    
    for(int a=0;a<N;a++){
      if(str.at(a)==1){    //1の人の時
        if(x=0){
          if(vec(a)==1){
            x=1;
          }
          else{
            x=1;
          }
        }
        else{
          x=1;
        }
      }
      else{　　　　//0の人の時
        if(x=0){
        }
        else{
          if(vec(a)==1){
            x=0;
          }
          else{
            x=1;
          }
        }
      }
    }
  }
}

        
        

Compiler output:
a.cc:35:12: error: extended character 　 is not valid in an identifier
   35 |       else{　　　　//0の人の時
      |            ^
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc:35:12: error: extended character 　 is not valid in an identifier
a.cc: In function 'int main()':
a.cc:24:17: error: no match for call to '(std::vector<int>) (int&)'
   24 |           if(vec(a)==1){
      |              ~~~^~~
a.cc:35:12: error: '\U00003000\U00003000\U00003000\U00003000' was not declared in this scope
   35 |       else{　　　　//0の人の時
      |            ^~~~~~~~
a.cc:38:9: error: 'else' without a previous 'if'
   38 |         else{
      |         ^~~~
a.cc:39:17: error: no match for call to '(std::vector<int>) (int&)'
   39 |           if(vec(a)==1){
      |              ~~~^~~
Language: Java

import java.util.Scanner;
import java.util.ArrayList; 

class Calc{
    void solve(ArrayList<ArrayList<Long>> a,ArrayList<String> s,int t){
	for(int i=0;i<t;i++){
	    int w = 0;
	    for(int j=0;j<s.size();j++){
		for(int k=s.get(j).length()-1;k>=0;k--){
		    if(s.get(j).charAt(k)=='0'){
			if(w==1&&a.get(i).get(k)==1){
			    w = 0;
			}
		    }else{
			if(1==0&&a.get(i).get(k)==0){
			    w = 1;
			}
		    }
		}
	    }
	    System.out.println(w);
	}
    }
}

class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	int t = sc.nextInt();
	ArrayList<Long> ai = new ArrayList<>();
	ArrayList<ArrayList<Long>>ai2 = new ArrayList<>();
	ArrayList<String> p = new ArrayList<>();
	for(int i=0;i<t;i++){
	    int n = sc.nextInt();
	    for(int j=0;j<n;j++){
		ai.add(sc.nextLong()%2);
	    }
	    ai2.add(ai.clone());
	    for(int j=0;j<n;j++){
		p.add(sc.next());
	    }
	    ai.clear();
	}
	Calc calc = new Calc();
	calc.solve(ai2,p,t);
	sc.close();
      }
}


Compiler output:
Main.java:38: error: incompatible types: Object cannot be converted to ArrayList<Long>
	    ai2.add(ai.clone());
	                    ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <iostream>
#include <cstdio>
#define MN 220

typedef long long ll;

ll d[64], a[MN];
char s[MN];

bool ins(ll x)
{
	for(int i = 62; i >= 0; i--)
	{
		if((x >> i) & 1)
		{
			if(!d[i]) {d[i] = x; return 1;}
			x ^= d[i];
		}
	}
	return 0;
}

int main()
{
	int T; scanf("%d", &T);
	while(T--)
	{
		memset(d, 0, sizeof(d));
		int n; scanf("%d", &n);
		for(int i = 1; i <= n; i++) scanf("%lld", &a[i]);
		scanf("%s", s + 1);
		bool ok = 0;
		for(int i = n; i >= 1; i--)
		{
			if(s[i] == '0') ins(a[i]);
			else if(ins(a[i])) {ok = 1; break;}
		}
		printf("%d\n", ok);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: 'memset' was not declared in this scope
   28 |                 memset(d, 0, sizeof(d));
      |                 ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <cstdio>
  +++ |+#include <cstring>
    3 | #define MN 220
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long c[200];
int main(){
  long long a;
  cin>>a;
  for(int i=0;i<a;i++){
    long long b;
    cin>>b;
    int x=0;
    for(int j=0;j<b;j++){
      cin>>c[i];
    }
    string d;
    cin>>d;
    for(int i=0;i<b;i++){
      if(s[i]=='1'){
        if(x==1||c[i]%2==1)
          x=1;
        else
          x=0;
      }
    }
    cout<<x;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 's' was not declared in this scope
   17 |       if(s[i]=='1'){
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long c[200];
int main(){
  long long a;
  cin>>a;
  for(int i=0;i<a;i++){
    long long b;
    cin>>b;
    int x=0;
    for(int j=0;j<b;j++){
      cin>>c[i];
    }
    string d;
    cin>>d;
    for(int i=0;i<b;i++){
      if(s[i]=='1'){
        if(x==1||c[i]%i==1)
          x=1;
        else
          x=0;
      }
    }
  }
  cout<<x;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 's' was not declared in this scope
   17 |       if(s[i]=='1'){
      |          ^
a.cc:25:9: error: 'x' was not declared in this scope
   25 |   cout<<x;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long c[200];
int main(){
  long long a;
  cin>>a;
  for(int i=0;i<a;i++){
    long long b;
    cin>>b;
    int x=0;
    for(int j=0;j<b;j++){
      cin>>c[i];
    }
    string d;
    cin>>d;
    for(int i=0;i<b;i++){
      if(s[i]=='1'){
        if(x==1||x&c[i]==1)
          x=1;
        else
          x=0;
      }
    }
    cout<<x;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 's' was not declared in this scope
   17 |       if(s[i]=='1'){
      |          ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long c[200];
int main(){
  long long a;
  cin>>a;
  for(int i=0;i<a;i++){
    long long b;
    cin>>b;
    int x=0;
    for(int j=0;j<b;j++){
      cin>>c[i];
    }
    string d;
    cin>>d;
    for(int i=0;i<b;i++){
      if(s[i]=='1'){
        if(x==1||x&c[i]==1)
          x=1;
        else
          x=0;
      }
    }
  }
  cout<<x;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: 's' was not declared in this scope
   17 |       if(s[i]=='1'){
      |          ^
a.cc:25:9: error: 'x' was not declared in this scope
   25 |   cout<<x;
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long l;
int allans[101];
l a[201];
int main()
{
	int t;cin>>t;
	for(int c=0;c<t;c++)
	{
		int n;cin>>n;
		int x=0;
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		string s;cin>>s;
		for(int i=0;i<n;i++)
		{
			if(s[i]=='1')
				if(x==0)
					if(x!=a[i])
						x=1;
			if(s[i]=='0')
				if(x==1)
					if(x==a[i])
						x=0;
		}
		x=x%2
		allans[c]=x;
	}
	for(int i=0;i<t;i++)
		cout<<allans[i]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: expected ';' before 'allans'
   29 |                 x=x%2
      |                      ^
      |                      ;
   30 |                 allans[c]=x;
      |                 ~~~~~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int t;
	cin >> t;
	for (int i = 0; i < t; i++) {
		int n;
		cin >> n;
		int a[220];
		for (int j = 0; j < n; j++) {
			cin >> a[j];
		}
		sort(a, a + n);
		int x = 0;
		int mi = 1000000007;
		for (int j = 0; j < n; j++) {
			x ^= a[j];
			if (j != 0) {
				if (mi > a[j] - a[j - 1]) {
					ma = a[j] - a[j - 1];
				}
			}
		}
		string s;
		cin >> s;
		bool b = true, b1 = true;
		for (int j = 0; j < n; j++) {
			if (s[j] == '0') {
				b = false;
			}
			if (s[j] == '1') {
				b1 = false;
			}
		}
		if (b == true) {
			cout << "1" << endl;
		}
		else if (x > mi) {
			cout << "1" << endl;
		}
		else {
			cout << "0" << endl;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:41: error: 'ma' was not declared in this scope; did you mean 'mi'?
   37 |                                         ma = a[j] - a[j - 1];
      |                                         ^~
      |                                         mi
Language: C++

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cstdint>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <chrono>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#include <random>
#include <utility>
#include <limits>
#include <list>

/* template start */
 
#define rep(i, a, b) for (long long i = (a); (i) < (b); (i)++)
#define all(i) i.begin(), i.end()

#ifdef LOCAL
#define debug(...) std::cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out(){std::cerr<<std::endl;}

template<typename Head,typename... Tail>
void debug_out(Head h,Tail... t){
  std::cerr<<" "<<h;
  if(sizeof...(t)>0)std::cout<<" :";
  debug_out(t...);
}
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}

template<typename Num>
constexpr Num mypow(Num a, unsigned long long b) {
  if(b==0)return 1;
  if (a==0)return 0;
  Num x = 1;
  while (b > 0) {
    if(b & 1)x*=a;
    a*=a;
    b >>= 1;
  }
  return x;
}

/* template end */

using ll = long long;

int main() {
  std::cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  a
  //CE
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:88:3: error: 'a' was not declared in this scope
   88 |   a
      |   ^
Language: C++

#include <cstdio>
#include <string>
#include <iostream>
#include <math.h>

using namespace std;



void reduce(int arr[64][64], int lead[64], int* d) {
    for(int i = 0; i < *d-1; i++) {
        if(arr[*d-1][lead[i]]==1) {
            for(int k = lead[i]; k < 64; k++) {
                arr[*d-1][k] = arr[*d-1][k]^arr[i][k];
            }
        }
    }
    int t = 0;
    for(int i = 0; i < 64; i++) {
        if(arr[*d-1][i]!=0) {
            t = 1;
            lead[*d-1] = i;
            break;
        }
    }
    if(t==0) {
        *d = *d-1;
        return;
    }

    for(int i = *d-2; i >=0; i--) {
        if(lead[i+1]<lead[i]) {
            for(int j = 0; j < 64; j++) {
                t = arr[i][j];
                arr[i][j] = arr[i+1][j];
                arr[i+1][j] = t;
            }
            t = lead[i];
            lead[i] = lead[i+1];
            lead[i+1] = t;
        } else return;
    }
    return;
}


int solve() {
    int n;
    cin>>n;
    long *a = new long[n];
    for(int i = 0; i < n; ++i) {
        cin>>a[i];
    }
    string s;
    cin>>s;

    int arr[64][64];
    int lead[64];
    int d = 0;
    int t
    long temp;
    for(int i = s.length()-1; i >=0; i--) {
        t = d;
        temp = a[i];
        for(int j = 63; j >=0; j--) {
            arr[d][j] = temp%2;
            temp/=2;
        }
        d++;
        reduce(arr,lead,&d);

        if(s[i]=='1'&&t!=d) return 1;
    }
    return 0;


}


int main(void){

    

    long t;
    cin >>t;
    string ans;

    for(int i = 0 ; i < t; i++) {
        cout<<solve()<<"\n";
    }






    return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:61:5: error: expected initializer before 'long'
   61 |     long temp;
      |     ^~~~
a.cc:63:9: error: 't' was not declared in this scope
   63 |         t = d;
      |         ^
a.cc:64:9: error: 'temp' was not declared in this scope; did you mean 'tm'?
   64 |         temp = a[i];
      |         ^~~~
      |         tm
Language: C++

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

int main()
{
	int T;
	cin >> T ; 
	vector<int>S(T);
	vector<int>N(T);
  for(int i=0;i<T;i++){
    cin >> N.at(i);
    vector<vector<int>> A(T, vector<int>(N))
      for(int j=0;j<T;j++){
        cin >> A.at(i).at(j);
      }
    cin >> S.at(i);
  }
  
  for(int i=0;i<T;i++){
    cout << 1 << endl;
  }
  

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: expected ',' or ';' before 'for'
   13 |       for(int j=0;j<T;j++){
      |       ^~~
a.cc:13:19: error: 'j' was not declared in this scope
   13 |       for(int j=0;j<T;j++){
      |                   ^
Language: C

#include<stdio.h>
int main()
{
  int t,n,i=0,x=0;
   int a[n];
  int s[n];
  scanf("%d",&t);
  for(i=0;i<t;i++)
  {
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
      scanf("%d",&a[i]);
      scanf("%d",&s[i]);
    }
    for(i=0;i<n;i++)
    {
      if(s[i]==1 || x==0 )
      {
        x=x^a[i];
        x++;
      }
      else if(s[i]==0 || x!=0)
      {
        x=x^a[i];
        x++;
      }
    }
    if(i!=0)
      printf("1");
    else
      print("0");
    x=0;
  }
}
    
 

Compiler output:
main.c: In function 'main':
main.c:32:7: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   32 |       print("0");
      |       ^~~~~
      |       printf
Language: C

#include<stdio.h>
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n,i,x=0;
		scanf("%d",&n);
		int a[n];
		char s[n+1];
		for(i=0;i<n;i++)
		scanf("%d",&a[i]);
		scanf("%s",s);
		for(i=0;i<n;i++)
		{
			if(s[i]=='1'&&a[i]!=x)
			{
				if(x==0)x=x xor a[i];
			}
			if(s[i]=='0'&&a[i]==x)
			{
				if(x!=0)x=x xor a[i];
			}
		}
		if(x==0)printf("0\n");
		else printf("1\n");
	}
 }                                           

Compiler output:
main.c: In function 'main':
main.c:19:44: error: expected ';' before 'xor'
   19 |                                 if(x==0)x=x xor a[i];
      |                                            ^~~~
      |                                            ;
main.c:23:44: error: expected ';' before 'xor'
   23 |                                 if(x!=0)x=x xor a[i];
      |                                            ^~~~
      |                                            ;
Language: C

#include<stdio.h>
int main()
{
	int T,N,A[200];
	char S[200];
	scanf("%d",&T);
	while(T--)
	{
		int x=0;
		scanf("%d",&N);
		for(int i=0;i<N;i++)
			scanf("%d",&A[i]);
		gets(S);
		gets(S);
        for(int i=0;i<N;i++)
        {
        	if(S[i]=='1')
			{
				if(x==0)
					x=x xor A[i];
			}
			if(S[i]=='0')
			{
				if(x=!0)
					x=x xor A[i];
			}
		}
		if(x==0)
			printf("0\n");
		else
			printf("1\n");
	}
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
   13 |                 gets(S);
      |                 ^~~~
      |                 fgets
main.c:20:44: error: expected ';' before 'xor'
   20 |                                         x=x xor A[i];
      |                                            ^~~~
      |                                            ;
main.c:25:44: error: expected ';' before 'xor'
   25 |                                         x=x xor A[i];
      |                                            ^~~~
      |                                            ;
Language: C

#include<stdio.h>
int main()
{
  int t,n,i=0,x=0;
   int a[n];
  int s[n];
  scanf("%d",&t);
  for(i=0;i<t;i++)
  {
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
      scanf("%d",&a[i]);
      scanf("%d",&s[i]);
    }
    for(i=0;i<n;i++)
    {
      if(s==1 || x==0 )
      {
        x=x^a[i];
        x++;
      }
      else if(s==0 || x!=0)
      {
        x=x^a[i];
        x++;
      }
    }
    if(i!=0)
      printf("1");
    else
      print("0");
    x=0;
  }
}
    
 

Compiler output:
main.c: In function 'main':
main.c:18:11: warning: comparison between pointer and integer
   18 |       if(s==1 || x==0 )
      |           ^~
main.c:32:7: error: implicit declaration of function 'print'; did you mean 'printf'? [-Wimplicit-function-declaration]
   32 |       print("0");
      |       ^~~~~
      |       printf
Language: C++

/*
    *********************************
    @Author: Harith Insider
    *********************************
*/
#include<bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
#define pb push_back
#define ff first
#define ss second
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
void solve()
{
    ll n;
    cin>>n;
    vector<ll> arr(n);
    for(ll i=0;i<n;i++)
        cin>>vec[i];
    ll ans=0;
    string str;
    cin>>str;
    for(ll i=0;i<n;i++)
    {
        if(str[i]=='1')
        {
            if(ans==0)
                ans^=arr[i];
            else
                continue;
        }
        else
        {
            if(ans!=0)
                ans^=arr[i];
            else
                continue;
        }
    }
    if(ans==0)
        cout << 0 << endl;
    else
        cout << 1 << endl;
}
int main()
{
    fastio;
    int t;
    cin>>t;
    while(t--)
    {
        solve();
    }
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:20:14: error: 'vec' was not declared in this scope
   20 |         cin>>vec[i];
      |              ^~~
Language: C++

#include <bits/stdc++.h>
#inclide <bitset>
#include <string>
#include <math.h>
using namespace std;
int main()
{
  long t,n,arr[9999],ti,ni,k;
  string a;
  string x="0";
  cin>>t;
  for(ti=0;ti<t;ti++){
    cin>>n;
    for(ni=0;ni<n;ni++)cin>>arr[ni];
    cin>>a;
    bitset<a.size()> b1(a);
    for(k=0;k<a.size();k++){
      b1
    }
      
  }
 

Compiler output:
a.cc:2:2: error: invalid preprocessing directive #inclide; did you mean #include?
    2 | #inclide <bitset>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:16:18: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   16 |     bitset<a.size()> b1(a);
      |            ~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:16:18: error: call to non-'constexpr' function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
   16 |     bitset<a.size()> b1(a);
      |            ~~~~~~^~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' declared here
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
a.cc:16:18: note: in template argument for type 'long unsigned int'
   16 |     bitset<a.size()> b1(a);
      |            ~~~~~~^~
a.cc:16:25: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   16 |     bitset<a.size()> b1(a);
      |                         ^
      |                         |
      |                         std::string {aka std::__cxx11::basic_string<char>}
a.cc:18:9: error: expected ';' before '}' token
   18 |       b1
      |         ^
      |         ;
   19 |     }
      |     ~    
a.cc:21:4: error: expected '}' at end of input
   21 |   }
      |    ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

#include <bits/stdc++.h>

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int n,a[202];
string s;
int go(int x,int last){
    if(x==n) return last;
    if(s[x]=='0') return go(x+1,min(last,last^((a[x]>>bit)&1LL)));
    return go(x+1,max(last,last^((a[x]>>bit)&1LL)));
}
void solve(){
    cin>>n;
    rep(i,0,n) cin>>a[i];
    cin>>s; 
    cout<<!!go(0,0)<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Compiler output:
a.cc: In function 'long long int go(long long int, long long int)':
a.cc:22:55: error: 'bit' was not declared in this scope
   22 |     if(s[x]=='0') return go(x+1,min(last,last^((a[x]>>bit)&1LL)));
      |                                                       ^~~
a.cc:23:41: error: 'bit' was not declared in this scope
   23 |     return go(x+1,max(last,last^((a[x]>>bit)&1LL)));
      |                                         ^~~
Language: C++

		}
	return 0;
}

int main() {
#ifdef LOCAL
	FILE("");
#endif

	int Case = ri;
	while(Case--) {
		int n = ri;
		for(int i = 1; i <= n; i++) a[i] = rl;
		for(int i = 1; i <= n; i++) {
			char ch = ge;
			while(!isdigit(ch)) ch = ge;
			bel[i] = ch - '0';
		} int res = 0;
		for(int i = n; i >= 1; i--) {
			int ok = Insert(a[i]);
			if(bel[i] && ok) res = 1;
		} printf("%d\n", res);
	}
	return 0;
}

Compiler output:
a.cc:1:17: error: expected declaration before '}' token
    1 |                 }
      |                 ^
a.cc:2:9: error: expected unqualified-id before 'return'
    2 |         return 0;
      |         ^~~~~~
a.cc:3:1: error: expected declaration before '}' token
    3 | }
      | ^
a.cc: In function 'int main()':
a.cc:10:20: error: 'ri' was not declared in this scope
   10 |         int Case = ri;
      |                    ^~
a.cc:13:45: error: 'a' was not declared in this scope
   13 |                 for(int i = 1; i <= n; i++) a[i] = rl;
      |                                             ^
a.cc:13:52: error: 'rl' was not declared in this scope
   13 |                 for(int i = 1; i <= n; i++) a[i] = rl;
      |                                                    ^~
a.cc:15:35: error: 'ge' was not declared in this scope
   15 |                         char ch = ge;
      |                                   ^~
a.cc:16:32: error: 'isdigit' was not declared in this scope
   16 |                         while(!isdigit(ch)) ch = ge;
      |                                ^~~~~~~
a.cc:17:25: error: 'bel' was not declared in this scope
   17 |                         bel[i] = ch - '0';
      |                         ^~~
a.cc:20:41: error: 'a' was not declared in this scope
   20 |                         int ok = Insert(a[i]);
      |                                         ^
a.cc:20:34: error: 'Insert' was not declared in this scope
   20 |                         int ok = Insert(a[i]);
      |                                  ^~~~~~
a.cc:21:28: error: 'bel' was not declared in this scope
   21 |                         if(bel[i] && ok) res = 1;
      |                            ^~~
a.cc:22:19: error: 'printf' was not declared in this scope
   22 |                 } printf("%d\n", res);
      |                   ^~~~~~
a.cc:1:8: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 |                 }
Language: C++

#include<bits/stdc++.h>

int main(){
  int t;
  cin>>t;
  int num,temp;
  while(t--){
    cin>>num;
    while(num--){
    cin>>templ
    }
    if(num%2==1){
      cout<<"0"<<"\n";
    }else{
    cout<<"1"<<"\n";}
  }
  
  
return o;}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |   cin>>t;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:10: error: 'templ' was not declared in this scope; did you mean 'temp'?
   10 |     cin>>templ
      |          ^~~~~
      |          temp
a.cc:13:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |       cout<<"0"<<"\n";
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |     cout<<"1"<<"\n";}
      |     ^~~~
      |     std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:8: error: 'o' was not declared in this scope
   19 | return o;}
      |        ^
Language: C++

#include<stdio.h>
#include<iostream>

int main(){
  cout<<"Yay!:)";
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |   cout<<"Yay!:)";
      |   ^~~~
      |   std::cout
In file included from a.cc:2:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai arccos(-1);
#define keta(n) cout << fixed << setprecision((n));
#define ll long long;
int main(){
  int t;
  cin>>t;
 
  vector<int> a(n);
  rep(i,n)cin>>a[i];
  string s;
  cin>>s;
  int x=0;
  if(x==0)
    cout<<"10";
  



}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'n' was not declared in this scope
   13 |   vector<int> a(n);
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include<set> 
#include<math.h>
#define pai arccos(-1);
#define keta(n) cout << fixed << setprecision((n));
#define ll long long;
int main(){
  int t;
  cin>>t;
  cin>>n;
  vector<int> a(n);
  rep(i,n)cin>>a[i];
  string s;
  cin>>s;
  int x=0;
  if(x==0)
    cout<<"10";
  



}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'n' was not declared in this scope
   12 |   cin>>n;
      |        ^
Language: Java

import java.util.*;
import java.io.*;

class Main {
  static int solve(char [] s, int minPrefix) {
    int sum = 0, maxPrefix = 0;
    TreeSet <Integer> index = new TreeSet <> ();
    for(int i = 0; i < s.length; i++) {
      if(s[i] == '1') {
        sum += 1;
      } else {
        sum -= 1;
        if(s[i] == '?') {
          index.add(i);
          s[i] = '0';
        }
      }
      while(sum < minPrefix) {
        if(index.isEmpty()) return Integer.MAX_VALUE;
        int optIndex = index.last();
        index.remove(optIndex);
        s[optIndex] = '1';
        sum += 2;
      }
    }
    sum = 0;
    for(int i = 0; i < s.length; i++) {
      if(s[i] == '1') {
        sum += 1;
      } else {
        sum -= 1;
      }
      maxPrefix = Math.max(maxPrefix, sum);
    }
    return maxPrefix - minPrefix;
  }
  public static void main(String [] args) {
    Reader in = new Reader();
    char [] s = in.next().toCharArray();
    int sum = 0;
    int start = 0;
    for(int i = 0; i < s.length; i++) {
      if(s[i] == '0') sum -= 1;
      else sum += 1;
      start = Math.min(start, sum);
    }
    System.out.println(Math.min(solve(s.clone(), start), solve(s.clone(), start - 1)));
  }
}


Compiler output:
Main.java:38: error: Reader is abstract; cannot be instantiated
    Reader in = new Reader();
                ^
Main.java:39: error: cannot find symbol
    char [] s = in.next().toCharArray();
                  ^
  symbol:   method next()
  location: variable in of type Reader
2 errors
Language: C++

#include <iostream>
#include <limits>
using namespace std;

int main() {
  string s;
  cin >> s;
  int maxPrefix = 0, prefix[s.size() + 1];
  prefix[0] = 0;
  for (int i = 1; i <= s.size(); ++i) {
    if (s[i - 1] == '1') {
      prefix[i] = prefix[i - 1] + 1;
    } else {
      prefix[i] = prefix[i - 1] - 1;
    }
    maxPrefix = max(maxPrefix, prefix[i]);
  }
  auto solve = [&](int maxPrefix) {
    int capacity[s.size() + 1];
    for (auto i = s.size(), j = numeric_limits<int>::max(); i > 0; --i) {
      j = min(j, maxPrefix - prefix[i]);
      capacity[i] = j / 2;
    }
    int sum = 0, tempMaxPrefix = 0, tempMinPrefix = 0, count = 0;
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == '1') {
        ++sum;
      } else if (s[i] == '0') {
        --sum;
      } else if (capacity[i + 1] > count) {
        ++sum;
        ++count;
      } else {
        --sum;
      }
      tempMaxPrefix = max(tempMaxPrefix, sum);
      tempMinPrefix = min(tempMinPrefix, sum);
    }
    return tempMaxPrefix - tempMinPrefix;
  };
  cout << min(solve(maxPrefix), solve(maxPrefix + 1));
  return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:20:10: error: inconsistent deduction for 'auto': 'long unsigned int' and then 'int'
   20 |     for (auto i = s.size(), j = numeric_limits<int>::max(); i > 0; --i) {
      |          ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
char ch[N]; int n, cnt, c[N], tmp, res = 1e9;
inline check (int mx) {
	int mn = 0, t = 0;
	for (int i = 1; i <= n; ++i) {
		if (ch[i] == '0') ++t;
		else if (ch[i] == '1') --t;
		else (t + 1 + c[i + 1] <= mx) ? ++t : --t;
		mn = min (mn, t);	
	} res = min (res, mx - mn);
} 
signed main() {
	scanf ("%s", ch + 1); n = strlen (ch + 1);
	for (int i = n; i >= 1; --i)
		c[i] = max (0, c[i + 1] + ch[i] == '0' ? 1 : -1);
	for (int i = 1; i <= n; ++i) {
		ch[i] == '0' ? ++cnt : --cnt;
		tmp = max (tmp, cnt);
	} check (tmp), check (tmp + 1);
	return printf ("%d\n", res),  0;
}

Compiler output:
a.cc:5:8: error: ISO C++ forbids declaration of 'check' with no type [-fpermissive]
    5 | inline check (int mx) {
      |        ^~~~~
a.cc: In function 'int check(int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
   13 | }
      | ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int main() {
  std::cin.tie(0); std::ios::sync_with_stdio(false);
  std::string s; std::cin >> s;
  int da[4], db[4];
  da[0] = db[0] = da[3] = -1;
  da[1] = db[1] = db[3] = 1;
  int a = 0, b = 0, m = 0, M = 0;
  int c0 = a0-b0, c1 = c0 + 1, c2 = c0 + 1, c3 = c0 + 2;
  for(auto c: s) {
    a += da[c&3]; if(a < 0) { a += 1; m ^= 1; }
    b += db[c&3]; if(b > 0) { b -= 1; M ^= 1; }
    c0 = std::max(c0, a-b+m+M);
    c1 = std::max(c1, a-b+m+(M^1));
    c2 = std::max(c2, a-b+(m^1)+M);
    c3 = std::max(c3, a-b+(m^1)+(M^1));
  }
  fin(std::min(std::min(c0, c1), std::min(c2, c3)));
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:12: error: 'a0' was not declared in this scope; did you mean 'c0'?
   15 |   int c0 = a0-b0, c1 = c0 + 1, c2 = c0 + 1, c3 = c0 + 2;
      |            ^~
      |            c0
a.cc:15:15: error: 'b0' was not declared in this scope; did you mean 'c0'?
   15 |   int c0 = a0-b0, c1 = c0 + 1, c2 = c0 + 1, c3 = c0 + 2;
      |               ^~
      |               c0
a.cc:20:5: error: 'c1' was not declared in this scope; did you mean 'c'?
   20 |     c1 = std::max(c1, a-b+m+(M^1));
      |     ^~
      |     c
a.cc:21:5: error: 'c2' was not declared in this scope; did you mean 'c'?
   21 |     c2 = std::max(c2, a-b+(m^1)+M);
      |     ^~
      |     c
a.cc:22:5: error: 'c3' was not declared in this scope; did you mean 'c'?
   22 |     c3 = std::max(c3, a-b+(m^1)+(M^1));
      |     ^~
      |     c
a.cc:24:29: error: 'c1' was not declared in this scope; did you mean 'c0'?
   24 |   fin(std::min(std::min(c0, c1), std::min(c2, c3)));
      |                             ^~
      |                             c0
a.cc:24:43: error: 'c2' was not declared in this scope; did you mean 'c0'?
   24 |   fin(std::min(std::min(c0, c1), std::min(c2, c3)));
      |                                           ^~
      |                                           c0
a.cc:24:47: error: 'c3' was not declared in this scope; did you mean 'c0'?
   24 |   fin(std::min(std::min(c0, c1), std::min(c2, c3)));
      |                                               ^~
      |                                               c0
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int main() {
  std::cin.tie(0); std::ios::sync_with_stdio(false);
  std::string s; std::cin >> s;
  int da[4], db[4];
  da[0] = db[0] = da[3] = -1
  da[1] = db[1] = db[3] = 1;
  int a0 = 0, a1 = 1, b0 = 0, b1 = -1;
  int c0 = a0-b0, c1 = a0-b1, c2 = a1-b0, c3 = a1-b1;
  for(auto c: s) {
    a0 += da[c&3]; if(a0 < 0) a0 += 2;
    a1 += da[c&3]; if(a1 < 0) a1 += 2;
    b0 += db[c&3]; if(b0 > 0) b0 -= 2;
    b1 += db[c&3]; if(b1 > 0) b1 -= 2;
    c0 = std::max(c0, a0-b0);
    c1 = std::max(c1, a0-b1);
    c2 = std::max(c2, a1-b0);
    c3 = std::max(c3, a1-b1);
  }
  fin(std::min(std::min(c0, c1), std::min(c2, c3)));
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:29: error: expected ';' before 'da'
   12 |   da[0] = db[0] = da[3] = -1
      |                             ^
      |                             ;
   13 |   da[1] = db[1] = db[3] = 1;
      |   ~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#incluse <string.h>
#include <math.h>
 
int main(void){
  int i, j, s0, s1;
  char S[1000000];
  
  scanf("%s", S);
  j=1;
  s0=s1=0;
  for(i=0; i<strlen(S); i++){
    if(S[i]=='0')
      s0++;
    if(S[i]=='1')
      s1++;
    if(S[i]=='?'){
      if(s0>s1)
          s1++;
        else
          s0++;}
     if(abs(s0-s1)<j)
          j=abs(s0-s1);}
  printf("%d\n", j);
 
return 0;}

Compiler output:
main.c:3:2: error: invalid preprocessing directive #incluse; did you mean #include?
    3 | #incluse <string.h>
      |  ^~~~~~~
      |  include
main.c: In function 'main':
main.c:13:14: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   13 |   for(i=0; i<strlen(S); i++){
      |              ^~~~~~
main.c:5:1: note: include '<string.h>' or provide a declaration of 'strlen'
    4 | #include <math.h>
  +++ |+#include <string.h>
    5 | 
main.c:13:14: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   13 |   for(i=0; i<strlen(S); i++){
      |              ^~~~~~
main.c:13:14: note: include '<string.h>' or provide a declaration of 'strlen'
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD 1000000007
#define P pair<ll, ll>

string s;
ll n, ans = INF;
ll dp[1100000];
ll solve(ll ind){
    
    ll ma = 0, mi = 0, now = 0;
    REP(i, n){
        if (s[i] == '0') now--;
        if (s[i] == '1') now++;
        if (s[i] == '?'){
            if(now - 1 - dp[i] >= ind){
                now--;
            }
            else{
                now++;
            }
        }
        ma = max(now, ma);
        mi = min(now, mi);
    }
    //cout << ind << " " << abs(ma - mi) << endl;
    ans = min(ans, abs(ma - mi));
    return abs(ma - mi);
}
P sabu1(int from, int to) {
	for (;to - from > 1;) {
		int mid = (from + to) / 2;
		(solve(mid * 2) - solve((mid - 1) * 2) <= 0 ? from : to) = mid;
	}
	return P(from, to);
}
P sabu2(int from, int to) {
	for (;to - from > 30;) {
		int mid = (from + to) / 2;
		(solve(mid * 2 - 1) - solve((mid - 1) * 2 - 1) <= 0 ? from : to) = mid;
	}
	return P(from, to);
}
int main() {
    cin >> s;
    n = s.size();
    ll now = 0, mi = 0;
    REPR(i, n - 1){
        dp[i] = now - mi;
        if (s[i] == '0') now++;
        else now--;
        mi = min(now, mi);
        
    }
    P res = sabu1(-1e6 - 10, 1);
    FOR(i, res.first, res.second){
        solve(i);
    }
    P res = sabu2(-1e6 - 10, 1);
    FOR(i, res.first, res.second){
        solve(i);
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:7: error: redeclaration of 'std::pair<long long int, long long int> res'
   69 |     P res = sabu2(-1e6 - 10, 1);
      |       ^~~
a.cc:65:7: note: 'std::pair<long long int, long long int> res' previously declared here
   65 |     P res = sabu1(-1e6 - 10, 1);
      |       ^~~
Language: C++

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

typedef long long Int;
typedef pair<int,int> PII;
typedef vector<int> VInt;
 
#define FOR(i, a, b) for(i = (a); i < (b); ++i)
#define RFOR(i, a, b) for(i = (a) - 1; i >= (b); --i)
#define EACH(it, a) for(auto it = (a).begin(); it != (a).end(); ++it)
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define SIZE(a) int((a).size())
#define ALL(a) (a).begin(),(a).end()
#define MP make_pair

int f(VInt& s, vector<PII>& v, int mn)
{
	int pos = 0;
	int cnt = 0;
	int mx = 0;
	int i;
	FOR(i, 0, SIZE(s))
	{
		while(pos != SIZE(v) && v[pos].second < i) ++pos;
		if(S[i] == '?' && pos != SIZE(v)) 
		{
			int val = v[pos].first;
			int ind = v[pos].second;
			if(val - 2*cnt > mn + 1) ++cnt;
		}
		int t = s[i] - 2*cnt;
		mx = max(mx, t);
	}
}

void SolveTest(int test)
{
	string S;
	cin >> S;
	int i, j;
	int sum = 0;
	vector<PII> v;
	VInt s(SIZE(S));
	FOR(i, 0, SIZE(S))
	{
		sum += S[i] == '0' ? -1 : 1;
		s[i] = sum;
		v.push_back(PII(sum, i));
	}
	sort(ALL(v));
	int mn[] = { v[0].first - 1, v[0].first };
	int res = min(f(s, v, mn[0]) - mn[0], f(s, v, mn[1]) - mn[1]);
	cout << res << endl;
}

int main()
{
	int T, t;
	T = 1;
	FOR(t, 0, T) SolveTest(t);
	return 0;
};

Compiler output:
a.cc: In function 'int f(VInt&, std::vector<std::pair<int, int> >&, int)':
a.cc:25:20: error: 'S' was not declared in this scope
   25 |                 if(S[i] == '?' && pos != SIZE(v))
      |                    ^
a.cc:34:1: warning: no return statement in function returning non-void [-Wreturn-type]
   34 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
int main(){
  int a;
  int b;
  int c;
  int d;
  int e;
  int x;x=0;
  int y;y=0;
  int z;z-0;
  int i;
  i=0;
  char S[1000000];
  scanf("%c",S);
  a=strlen(S);
  for(i;i<a;i++){
    if(s[i]=='0')
      x++;
    if(s[i]=='1')
      y++;
    if(S[i]=='?')
      z++;
  }
  if(x<y){
    b=y-x;
    if(z>b){
      d=z-b;
      printf("%d|n",d%2);
    }else{
      printf("%d|n",b-z);
    }
  }else{
    c=x-y;
    if(z>c)
      e=z-c;
    printf("%d|n",c%2);
  }else{
    printf("%d|n",c-z);
  }
  return 0;
  }
  
  

Compiler output:
main.c: In function 'main':
main.c:18:8: error: 's' undeclared (first use in this function)
   18 |     if(s[i]=='0')
      |        ^
main.c:18:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:38:4: error: 'else' without a previous 'if'
   38 |   }else{
      |    ^~~~
Language: C++

#include <bits/stdc++.h>
#include "debug.cpp"

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n,a,b;
	cin >> n >> a >> b;
	
	long long mod=1000000007;
	
	//a<=b
	if(a>b) swap(a,b);
	
	vector<vector<long long>> dp(n+1,vector<long long>(b));
	vector<vector<long long>> dp2(n+1,vector<long long>(b));
	vector<long long> res(n+1);
	dp[0][0]=1;
	dp2[0][0]=0;
	
	for(int i=0;i<n;i++){
		res[i+1]+=(res[i]*2)%mod;
		res[i+1]%=mod;
		
		//add 1
		for(int j=0;j<n;j++){
			if((j+1)<b){
				dp[i+1][j+1]+=dp[i][j];
				dp[i+1][j+1]+=dp2[i][j];
				dp[i+1][j+1]%=mod;
			}
		}
		res[i+1]+=dp[i][b-1];
		res[i+1]+=dp2[i][b-1]*2;
		res[i+1]%=mod;
		
		//add 0
		for(int j=0;j<n;j++){
			if((j+1)<b){
				dp2[i+1][j+1]+=dp2[i][j];
				dp2[i+1][j+1]%=mod;
			}
			if(j<b){
				dp[i+1][0]+=dp[i][j];
				dp[i+1][0]%=mod;
			}
		}
		if((i+1-a)>=0){
			for(int j=1;j<b;j++){
				dp[i+1][0]=(dp[i+1][0]+mod-dp[i+1-a][j])%mod;
			}
			if((i+1-a)==0) dp[i+1][0]=(dp[i+1][0]+mod-1)%mod;
		}
		
		for(int j=1;j<n;j++){
			if((i+a)>n) continue;
			if((j+a)<b){
				dp2[i+a][j+a]+=dp[i][j];
				dp2[i+a][j+a]%=mod;
			}else if(j<b){
				res[i+a]+=dp[i][j];
				res[i+a]%=mod;
			}
		}
		if(i==0){
			if(a<b){
				dp2[i+a][a]+=dp[i][0];
				dp2[i+a][a]%=mod;
			}else{
				res[i+a]+=dp[i][0];
				res[i+a]%=mod;
			}
		}
	}
	cout << res[n] << "\n";
	return 0;
}

Compiler output:
a.cc:2:10: fatal error: debug.cpp: No such file or directory
    2 | #include "debug.cpp"
      |          ^~~~~~~~~~~
compilation terminated.