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

#include<cstdio>
#include<iostream>
using namespace std;
int n,r,a[200005],s[25];
long long ans;
void insert(int x){
	for(int i=1;i<=20;i++) s[i]+=x&1,x>>=1;
}
void del(int x){
	for(int i=1;i<=20;i++) s[i]-=x&1,x>>=1;
}
bool check(int x){
	for(int i=1;i<=20;i++){
		if(s[i]==1 && (x&1)==1) return 0;
		x>>=1;
	}
	return 1;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	r=1;
	insert(a[1]);
	for(int i=1;i<=n;i++){
		ans+=r-i+1;
		while(r<n && check(a[r+1])) ans++,insert(a[++r]);
		del(a[i]);
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include<bits/stdc++.h>
using namespace std;
int n,r,a[200005],s[25];
long long ans;
void insert(int x){
	for(int i=1;i<=20;i++) s[i]+=x&1,x>>=1;
}
void del(int x){
	for(int i=1;i<=20;i++) s[i]-=x&1,x>>=1;
}
bool check(int x){
	for(int i=1;i<=20;i++){
		if(s[i]==1 && (x&1)==1) return 0;
		x>>=1;
	}
	return 1;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	r=1;
	insert(a[1]);
	for(int i=1;i<=n;i++){
		ans+=r-i+1;
		while(r<n && check(a[r+1])) ans++,insert(a[++r]);
		del(a[i]);
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
int main(){
  ll n;
  cin>>n;
  vector<ll> v(n);
  rep(i,n) cin>>v[i];
  ll ans=0;
  ll right=0;
  ll sum=0;
  rep(left,n){
    while(right<n && (sum^v[right])==(sum+v[rihgt])){
      sum+=v[right];
      right++;
    }
    ans+=right-left;
    if(left==right) right++;
    else sum-=v[right];
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:45: error: 'rihgt' was not declared in this scope; did you mean 'right'?
   14 |     while(right<n && (sum^v[right])==(sum+v[rihgt])){
      |                                             ^~~~~
      |                                             right
Language: C++

#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
#include <tuple>
#include <numeric>
#include <assert.h>
#include <functional>
#include <unordered_map>

using namespace std;

/*-----------------------------------------------------------------------------
　定義
 -------------------------------------------------------------------------------*/
#define ALL(a)			a.begin(), a.end()
#define REP(i, n)		for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n)	for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define INF				2e9
#define MOD				(1000 * 1000 * 1000 + 7)
#define Ceil(x, n)		(((((x))+((n)-1))/n))		/* Nの倍数に切り上げ割り算 */
#define CeilN(x, n)		(((((x))+((n)-1))/n)*n)		/* Nの倍数に切り上げ */
#define FloorN(x, n)	((x)-(x)%(n))				/* Nの倍数に切り下げ */
#define IsOdd(x)		(((x)&0x01UL) == 0x01UL)			
#define IsEven(x)		(!IsOdd((x)))						
#define	MAX_QWORD		((QWORD)0xFFFFFFFFFFFFFFFF)
#define M_PI			3.14159265358979323846
typedef long long		ll;
typedef pair<ll, ll>	P;

/*-----------------------------------------------------------------------------
　処理
 -------------------------------------------------------------------------------*/
/* 階乗を求める(MOD付) */
ll factorial(ll kaijou)
{
	ll sumRes = 1;
	for (ll i = 1; i <= kaijou; i++) {
		ll sumPrev = sumRes % MOD;
		ll sumNext = sumPrev * (i % MOD);
		sumRes = sumNext % MOD;
	}
	return sumRes;
}
##
int main()
{
	int N;
	cin >> N;
	vector<int> A(N);
	REP(i, N) cin >> A[i];
	
	int ans = 0;
	int sum = 0;
	int rCnt = 1;
	for (int lCnt = 0; lCnt < N; lCnt++) {
		int cnt = 1;
		sum += A[lCnt];
		for (int rCnt = 0; rCnt < N; rCnt++) {
			if (sum + A[lCnt + rCnt] == sum ^ A[lCnt + rCnt]) {
				sum += A[lCnt + rCnt];
				rCnt++;
			} else {
				break;
			}
		}
		rCnt = lCnt + cnt;
		ans += factorial(cnt);
		sum -= A[lCnt];
	}

	return 0;
}



Compiler output:
a.cc:55:1: error: stray '##' in program
   55 | ##
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long
int main(){
  int N;cin>>N;
  vector<int> A(N);for(int i=0;i<N;i++)cin>>A[i];
  int ans=0;
  int r=0;
  int s=0;
  for(int l=0;l<N;l++){
    while((!(s&A[r]))&&r<N){
    //while(s|A[r]==s+A[r]&&r<N){
      s|=A[r];
      r++;
    }
    ans+=r-l;
    s=s^A[l];
  }
  cout<<ans;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
int n,a[200010];
int ans=0;
int main(){
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a[i];
	}
	int l=1,r=1,sumx=a[1],sum=a[1];
	for(int i=1;i<=n;i++){
		while((sumx==sum)&&r<=n){
			sum+=a[r+1];
			sumx^=a[r+1];
			r++;
		}
		ans+=(r-1)-l+1;
		sumx^=a[l];
		sum-=a[l];
		l++;
		if(r<l){
			r=l;
		}
	}
	cout << ans;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
long long f[maxn],s[maxn];
long long ans;
int main()
{
    int n,x;
    cin>>n;
    f[0]=0,s[0]=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x
        f[i]=f[i-1]+x;
        s[i]=s[i-1]^x;
    }
    int L=1;
    ans=0;
    for(int R=1;R<=n;R++)
    {
        while((f[R]-f[L-1])!=(s[R]^s[L-1])) L++;
        ans+=R-L+1;
    }
    cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:15: error: expected ';' before 'f'
   13 |         cin>>x
      |               ^
      |               ;
   14 |         f[i]=f[i-1]+x;
      |         ~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N=2e5+10;
ll sum[N],x[N];
ll a[N];
int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)
		cin>>a[i];
    sum[1]=x[1]=a[1];
    for(int i=2;i<=n;i++)
		sum[i]=sum[i-1]+a[i],x[i]=x[i-1]^a[i];
    ll ans=0;
	int l=1;
    for(int r=1;r<=n;r++)
	{
        for(;sum[r]-sum[l-1]!=(X[r]^X[l-1]);l++);
	    ans+=(r-l+1);
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:32: error: 'X' was not declared in this scope
   20 |         for(;sum[r]-sum[l-1]!=(X[r]^X[l-1]);l++);
      |                                ^
Language: C++

#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int n;
	cin >> n;
    int a[n];
    fr(i,n){
      cin >> a[i];
    }
    int ans=0;
    fr(i,n-1){
      int now = a[i];
      fr(j,1,n-i){
        if(now^a[i+j]==now+a[i+j]){
          now+=a[i+j];
        }else{
          ans+=j-1;
          break;
        }
      }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:25:17: error: macro "fr" passed 3 arguments, but takes just 2
   25 |       fr(j,1,n-i){
      |                 ^
a.cc:10:9: note: macro "fr" defined here
   10 | #define fr(i,n) for(int i=0;i<n;i++)
      |         ^~
a.cc: In function 'int main()':
a.cc:25:7: error: 'fr' was not declared in this scope
   25 |       fr(j,1,n-i){
      |       ^~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define N 200000
int n,tot;
int l,r;
int a[N+1];
int x[N+1];
int s[N+1];
int main(int argc,char *argv[]){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		s[i]=s[i-1]+a[i];
		x[i]=x[i-1]^a[i];
	}
	int r=1;
	for(int i=1;i<=n;i++){
		r=max(r,i);
		while(s[r+1]-s[i-1]==x[r+1]-x[i-1] && r+1<=n)	r++;
		tot+=r-i+1;
	}
	printf("%d",tot);
	return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxn=200010;
int n;
int a[maxn];
int ind[21];
int main()
{
	memset(ind,0,sizeof(ind));
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	int res=0;
	int x=0;
	for(int i=0;i<n;i++)
	{
		res+=(int(i+1)); 
		for(int k=0;k<=20;k++)
		{
			int u=a[i]&(1<<k);
			if(ind[k]>0&&u)
			{
				x=max(x,ind[k]);
			}
			if(u)
			{
				ind[k]=i+1
			}
		}
		res-=x; 
	}
	cout<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:43: error: expected ';' before '}' token
   27 |                                 ind[k]=i+1
      |                                           ^
      |                                           ;
   28 |                         }
      |                         ~
Language: C

#include <iostream>
using namespace std;
int main()
{
	int sum=0,n,a[10005],ago[20],i,j,biggest=0;
	cin>>n;
	for(i=0;i<20;i++) ago[i]=-1 ;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
		for(j=0;j<20;j++)
		{
			if(a[i]&(1<<j))
			{
				biggest=max(biggest,ago[j]+1);
				ago[j]=i;
			}
		}
		sum=sum+i-biggest+1;
	}
	cout<<sum<<endl; 
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include <bits/stdc++.h>
using namespace std;
int main()
{
	int sum=0,n,a[10005],ago[20],i,j,biggest=0;
	cin>>n;
	for(i=0;i<20;i++) ago[i]=-1 ;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
		for(j=0;j<20;j++)
		{
			if(a[i]&(1<<j))
			{
				biggest=max(biggest,ago[j]+1);
				ago[j]=i;
			}
		}
		sum=sum+i-biggest+1;
	}
	cout<<sum<<endl; 
	return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;

vi binary_digit(ll a){
  vi ans(22);
  for (int i=0;i<22;++i){
    int t=(a>>i)&1;
    ans[i]=t;
  }
  return ans;
}

int find_diff_max(vi& v, vi&w){
  int ans=0;
  int N=v.size();
  for (int i=0;i<N;++i){
    ans=max(ans, v[i]-w[i]);
  }
  return ans;
}



int main(){
  int N;cin>>N;
  vi a;
  for (int i=0;i<N;++i){
    int a_;cin>>a_;a.push_back(a_);
  }

  vi cumsum[N];
  cumsum[0]=binary_digit(a[0]);
  for (int i=1;i<N;++i){
    vi v=binary_digit(a[i]);
    for (int j=0;j<22;++j){
      cumsum[i][j]=cumsum[i-1][j]+v[j];
    }
  }

  ll count =0;
  
  for (int s=0;s<N;++s){
    int low=s;
    int high=N-1;
    int f;
    while(high-low>1){
      mid=(high+low)/2;
      if(s==0){f=0;
        for (int i=0;i<22;++i){
          f=max(cumsum[mid][i], 0);
        }
      }else{
        f=find_diff_max(cumsum[mid],cumsum[s-1]);
      }
      if(f<=1){lb=mid;}else{ub=mid;}
    }
    count+=lb-s+1;
  }

  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:7: error: 'mid' was not declared in this scope
   49 |       mid=(high+low)/2;
      |       ^~~
a.cc:57:16: error: 'lb' was not declared in this scope; did you mean 'll'?
   57 |       if(f<=1){lb=mid;}else{ub=mid;}
      |                ^~
      |                ll
a.cc:57:29: error: 'ub' was not declared in this scope
   57 |       if(f<=1){lb=mid;}else{ub=mid;}
      |                             ^~
a.cc:59:12: error: 'lb' was not declared in this scope; did you mean 'll'?
   59 |     count+=lb-s+1;
      |            ^~
      |            ll
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;

vi binary_digit(ll a){
  vi ans(22);
  for (int i=0;i<22;++i){
    int t=(a>>i)&1;
    ans[i]=t;
  }
  return ans;
}

int main(){
  int N;cin>>N;
  vi a;
  for (int i=0;i<N;++i){
    int a_;cin>>a_;a.push_back(a_);
  }
  ll count =0;
  
  for (s=0;s<N;++s){
    vi digit_counter(22, 0);
    int m=0;
    for (t=s;t<N;++t){
      vi v=binary_digit(a[t]);
      for (int j=0;j<22;++j){
        digit_counter[j]+=v[j];
        m=max(m, digit_counter[j]);
      }
      if(m<2){count++;}
      if(m>=2){break;}
    }
  }

  cout << count << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:8: error: 's' was not declared in this scope
   23 |   for (s=0;s<N;++s){
      |        ^
a.cc:26:10: error: 't' was not declared in this scope
   26 |     for (t=s;t<N;++t){
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;

vi binary_digit(ll a){
  vi ans(22);
  for (int i=0;i<22;++i){
    int t=(a>>i)&1;
    ans[i]=t;
  }
  return ans;
}

int main(){
  int N;cin>>N;
  vi a;
  for (int i=0;i<N;++i){
    int a_;cin>>a_;a.push_back(a_);
  }
  ll count =0;
  int s=0,t=0;
  vi digit_counter(22, 0);
  int m=0;
  for (;;){
    while(t<N&&m<2){
      count++;
      vi v=binary_digit(a[t]);
      for (j=0;j<22;++j){
        digit_counter[j]+=v[j];
        m=max(m, digit_counter[j]);
      }
      t++;
    }
    vi w=binary_digit(a[s]);
    m=0;
    for (j=0;j<22;++j){
      digit_counter[j]-=w[j];
      m=max(m, digit_counter[j]);
    }
    s++;
    if(s==N){break;}
  }

  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: 'j' was not declared in this scope
   29 |       for (j=0;j<22;++j){
      |            ^
a.cc:37:10: error: 'j' was not declared in this scope
   37 |     for (j=0;j<22;++j){
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;

vi binary_digit(ll a){
  vi ans(22);
  for (int i=0;i<22;++i){
    int t=(a>>j)&1;
    ans[i]=t;
  }
  return ans;
}

int main(){
  ll count =0;
  int s=0,t=0;
  vi digit_counter(22, 0);
  int m=0;
  for (;;){
    while(t<N&&m<2){
      count++;
      vi v=binary_digit(a[t]);
      for (j=0;j<22;++j){
        digit_counter[j]+=v[j];
        m=max(m, digit_counter[j]);
      }
      t++;
    }
    vi w=binary_digit(a[s]);
    m=0;
    for (j=0;j<22;++j){
      digit_counter[j]-=w[j];
      m=max(m, digit_counter[j]);
    }
    s++;
    if(s==N){break;}
  }

  cout << count << endl;
  return 0;
}

Compiler output:
a.cc: In function 'vi binary_digit(ll)':
a.cc:9:15: error: 'j' was not declared in this scope
    9 |     int t=(a>>j)&1;
      |               ^
a.cc: In function 'int main()':
a.cc:21:13: error: 'N' was not declared in this scope
   21 |     while(t<N&&m<2){
      |             ^
a.cc:23:25: error: 'a' was not declared in this scope
   23 |       vi v=binary_digit(a[t]);
      |                         ^
a.cc:24:12: error: 'j' was not declared in this scope
   24 |       for (j=0;j<22;++j){
      |            ^
a.cc:30:23: error: 'a' was not declared in this scope
   30 |     vi w=binary_digit(a[s]);
      |                       ^
a.cc:32:10: error: 'j' was not declared in this scope
   32 |     for (j=0;j<22;++j){
      |          ^
a.cc:37:11: error: 'N' was not declared in this scope
   37 |     if(s==N){break;}
      |           ^
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<vector<int>> vec;
  for(int i = 0; i < N; i++){
    int A;
    cin >> A;
    vector<int> v;
    int c = 0;
    while(A){
      if(A % 2) v.push_back(c);
      A /= 2;
      c++;
    }
    vec.push_back(v);
  }
  int s = 0, t = 0
  ll ans = 0;
  int use[20] = {0};

  while(true){
    while(t < N){
      bool can = true;
      for(int x : vec[t]){
        if(use[x]) can = false;
      }
      if(!can) break;
      for(int x : vec[t]){
        use[x]++;
      }
      t++;
    }
    if(s == N) break;
    ans += t - s;
    for(int x : vec[s]){
      use[x]--;
    }
    s++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: expected ',' or ';' before 'll'
   22 |   ll ans = 0;
      |   ^~
a.cc:38:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |     ans += t - s;
      |     ^~~
      |     abs
a.cc:44:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   44 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }


int main() {
	
	ll N;
	cin >> N;
	vll A(N);
	rep(i, N) cin >> A[i];

	ll ans = 0;
	rep(i, N) {
		ll xor = 0, sum = 0, tmp = 0;
		fori(j, i, N) {
			xor ^= A[j]; sum += A[j];
			if (xor == sum) ++tmp;
			else break;
		}
		ans += tmp;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:20: error: expected unqualified-id before 'xor' token
   42 |                 ll xor = 0, sum = 0, tmp = 0;
      |                    ^~~
a.cc:44:25: error: expected primary-expression before 'xor' token
   44 |                         xor ^= A[j]; sum += A[j];
      |                         ^~~
a.cc:44:29: error: expected primary-expression before '^=' token
   44 |                         xor ^= A[j]; sum += A[j];
      |                             ^~
a.cc:44:38: error: 'sum' was not declared in this scope
   44 |                         xor ^= A[j]; sum += A[j];
      |                                      ^~~
a.cc:45:29: error: expected primary-expression before 'xor' token
   45 |                         if (xor == sum) ++tmp;
      |                             ^~~
a.cc:45:33: error: expected primary-expression before '==' token
   45 |                         if (xor == sum) ++tmp;
      |                                 ^~
a.cc:45:43: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   45 |                         if (xor == sum) ++tmp;
      |                                           ^~~
      |                                           tm
a.cc:48:24: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   48 |                 ans += tmp;
      |                        ^~~
      |                        tm
Language: C++

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

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) cin >> a[i];
    int right = 0, sum = 0;
    ll res = 0;
    for(int left = 0; left < n; left++){
        while(right < n && (sum ^ a[right]) == (sum + a[right])) sum += a[right++];
        res += right - left;
        if(right == left) right++;
        else sum -= a[left];
    }
    cout << res << endl;
    return 0;
}
#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) cin >> a[i];
    int right = 0, sum = 0;
    ll res = 0;
    for(int left = 0; left < n; left++){
        while(right < n && (sum ^ a[right]) == (sum + a[right])) sum += a[right++];
        res += right - left;
        if(right == left) right++;
        else sum -= a[left];
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc:25:5: error: redefinition of 'int main()'
   25 | int main(){
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main(){
      |     ^~~~
Language: C++

#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

signed main(){
    int N;
    cin >> N;
    
    int B[N];
    
    for(int i = 0; i < N; ++i){
        cin >> B[i];
    }
}
    

    int cnt = 0;
    for(int l = 0; l < N; ++l){
        int sum1 = 0;
        int sum2 = 0;
        for(int r = l; r < N; ++r){
            sum1 += B[r];
            sum2 ^= B[r];
            if(sum1 == sum2){
                ++cnt;
            } else {
                break;
            }
        }
    }
    cout << cnt << endl;
    

Compiler output:
a.cc:22:5: error: expected unqualified-id before 'for'
   22 |     for(int l = 0; l < N; ++l){
      |     ^~~
a.cc:22:20: error: 'l' does not name a type
   22 |     for(int l = 0; l < N; ++l){
      |                    ^
a.cc:22:27: error: expected unqualified-id before '++' token
   22 |     for(int l = 0; l < N; ++l){
      |                           ^~
a.cc:35:5: error: 'cout' does not name a type
   35 |     cout << cnt << endl;
      |     ^~~~
Language: C++

#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

signed main(){
    int N;
    cin >> N;
    
    int B[N];
    
    for(int i = 0; i < N; ++i){
        cin >> B[i];
    }
    

    int cnt = 0;
    for(int l = 0; l < N; ++l){
        int sum1 = 0;
        int sum2 = 0;
        for(int r = l; r < N; ++r){
            sum1 += B[r];
            sum2 ^= B[r];
            if(sum1 == sum2){
                ++cnt;
            } else {
                break;
            }
        }
    }
    cout << cnt << endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:34:25: error: expected '}' at end of input
   34 |     cout << cnt << endl;
      |                         ^
a.cc:9:14: note: to match this '{'
    9 | signed main(){
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
inline int read(){
	char ch=getchar(); int w=1,c=0;
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') w=-1;
	for (;isdigit(ch);ch=getchar()) c=(c<<1)+(c<<3)+(ch^48);
	return w*c;
}
int n,m,A;
int a[201201];
int main(){
  	n=read(); 
  	for (int i=1;i<=n;i++) a[i]=read();
  	int r=0;
	LL nans=0;
  	for (int i=1;i<=n;i++){
  		while ((nans^a[r+1])==nans+a[r+1] && r<n) nans+=a[r+1],r++;
  		A=A+r-i+1;
  		nans-=a[i];
	}
	cout<<A<<"\n";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'LL' was not declared in this scope
   15 |         LL nans=0;
      |         ^~
a.cc:17:25: error: 'nans' was not declared in this scope; did you mean 'nanl'?
   17 |                 while ((nans^a[r+1])==nans+a[r+1] && r<n) nans+=a[r+1],r++;
      |                         ^~~~
      |                         nanl
a.cc:19:17: error: 'nans' was not declared in this scope; did you mean 'nanl'?
   19 |                 nans-=a[i];
      |                 ^~~~
      |                 nanl
Language: C++

#include<bits/stdc++.h>
#pragma warning(disable:4996)
using namespace std;
using ll = long long;
using ld = long double;
const int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
//const long double PI = acos(-1.0);
#define int long long
signed main() {
	int r = 0;
	int now_sum = 0;
	int now_xor = 0;
	ll ans = 0;
	for (int l = 0; l < n; l++) {
		while (r < n && (now_sum + v[r]) == (now_xor^v[r])) {
			now_sum += v[r];
			now_xor ^= v[r];
			r++;
		}
		ans += r - l;
		now_sum -= v[l];
		now_xor ^= v[l];//(A xor B xor C) xor B = (A xor B xor C)
	}

	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: 'n' was not declared in this scope
   14 |         for (int l = 0; l < n; l++) {
      |                             ^
a.cc:15:44: error: 'v' was not declared in this scope
   15 |                 while (r < n && (now_sum + v[r]) == (now_xor^v[r])) {
      |                                            ^
a.cc:21:28: error: 'v' was not declared in this scope
   21 |                 now_sum -= v[l];
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	int n, k
	ll ans = 0;
	cin >> n;

	int f[n + 1], s[n + 1];
	
	f[0] = 0; s[0] = 0;
	
	for (int i = 1; i <= n; i++)
	{
		cin >> k;
		f[i] = f[i - 1] + k;
		s[i] = s[i - 1] ^ k;
	}
	
	int l = 1;
	
	for (int r = 1; r <= n; r++)
	{
		while ((f[r]-f[l-1]) != (s[r]^s[l-1])) l++;
		ans += r - l + 1;
	}
	
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'll'
    7 |         ll ans = 0;
      |         ^~
a.cc:16:24: error: 'k' was not declared in this scope
   16 |                 cin >> k;
      |                        ^
a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |                 ans += r - l + 1;
      |                 ^~~
      |                 abs
a.cc:29:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

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

int main()
{
	int n, k
	long long int ans = 0;
	cin >> n;

	int f[n + 1], s[n + 1];
	
	f[0] = 0; s[0] = 0;
	
	for (int i = 1; i <= n; i++)
	{
		cin >> k;
		f[i] = f[i - 1] + k;
		s[i] = s[i - 1] ^ k;
	}
	
	int l = 1;
	
	for (int r = 1; r <= n; r++)
	{
		while ((f[r]-f[l-1]) != (s[r]^s[l-1])) l++;
		ans += r - l + 1;
	}
	
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: expected initializer before 'long'
    7 |         long long int ans = 0;
      |         ^~~~
a.cc:16:24: error: 'k' was not declared in this scope
   16 |                 cin >> k;
      |                        ^
a.cc:26:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   26 |                 ans += r - l + 1;
      |                 ^~~
      |                 abs
a.cc:29:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		long[] a = new long[n];
		for(int i=0;i<n;i++) {
			a[i] = in.nextLong();
		}
		long res = 0;
		int r = 0;
		long sum = 0;
		for(int l=0;l<n;l++) {
			 while(r<n && (sum^a[r])==(sum+a[r])) {
				 sum += a[r++];
			 }
			res += r-l;
			sum -= a[l];
			if(l==r) r++;
		}
		System.out.println(res);
		in.close();
	}

}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner in = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include<iostream>
using namespace std;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define REP(i,n) FOR(i,0,n)

int N
ull s;
ull A[20000];

bool check(ull x) {
  if ((s ^ x) != (s + x)) return false;
  s ^= x;
  return true;
}

int main() {
  scanf("%d", &N);
  REP(i,N) scanf("%llu", &A[i]);

  ull count = 0;
  int j = 0;
  REP(i,N) {
    while((j < N) && check(A[j])) ++j;
    count += j - i;
    s ^= A[i];
  }

  printf("%d\n", count);
  return 0;
}

Compiler output:
a.cc:9:1: error: expected initializer before 'ull'
    9 | ull s;
      | ^~~
a.cc: In function 'bool check(ull)':
a.cc:13:8: error: 's' was not declared in this scope
   13 |   if ((s ^ x) != (s + x)) return false;
      |        ^
a.cc:14:3: error: 's' was not declared in this scope
   14 |   s ^= x;
      |   ^
a.cc: In function 'int main()':
a.cc:19:16: error: 'N' was not declared in this scope
   19 |   scanf("%d", &N);
      |                ^
a.cc:27:5: error: 's' was not declared in this scope
   27 |     s ^= A[i];
      |     ^
Language: C++

#include <iostream>
#include <string>
#include <stdlib.h>
#include <cstdint>
using namespace std;

#define N 200000

int a[N];
long long sum[N+1];
int xor[N+1];

int main() {
	int n;
	long long ans = 0;

	cin >> n;
	for( int i = 0; i < n; i++ ) {
		cin >> a[i];
	}

	long long tmpSum = 0;
	for( int i = 0; i < n; i++ ) {
		sum[i] = tmpSum;
		tmpSum += a[i];
	}

	int x = 0;
	for( int i = 0; i < n; i++ ) {
		xor[i] = x;
		x ^= a[i];
	}

	for( int l = 0; l < n; l++ ) {
		for( int r = l + 1; r < n+1; r++ ) {
			if( sum[r] - sum[l] == (xor[r] ^ xor[l]) ) {
				ans++;
			}
		}
	}

	cout << ans << "\n";

	return 0;
}


Compiler output:
a.cc:11:5: error: expected unqualified-id before 'xor' token
   11 | int xor[N+1];
      |     ^~~
a.cc: In function 'int main()':
a.cc:30:17: error: expected primary-expression before 'xor' token
   30 |                 xor[i] = x;
      |                 ^~~
a.cc: In lambda function:
a.cc:30:24: error: expected '{' before '=' token
   30 |                 xor[i] = x;
      |                        ^
a.cc: In function 'int main()':
a.cc:36:49: error: expected primary-expression before 'xor' token
   36 |                         if( sum[r] - sum[l] == (xor[r] ^ xor[l]) ) {
      |                                                 ^~~
a.cc: In lambda function:
a.cc:36:56: error: expected '{' before '^' token
   36 |                         if( sum[r] - sum[l] == (xor[r] ^ xor[l]) ) {
      |                                                        ^
a.cc: In function 'int main()':
a.cc:36:58: error: expected primary-expression before 'xor' token
   36 |                         if( sum[r] - sum[l] == (xor[r] ^ xor[l]) ) {
      |                                                          ^~~
a.cc: In lambda function:
a.cc:36:64: error: expected '{' before ')' token
   36 |                         if( sum[r] - sum[l] == (xor[r] ^ xor[l]) ) {
      |                                                                ^
Language: C++

#include<bits/stdc++.h>

typedef long long ll;
#define int ll;

using namespace std;

const int N=2e5+100;
int a[N];

signed main()
{
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
int ans=0;
for(int i=0,j=0,x=0;i<n;i++)
{
while(j<n&&!(x^a[j])) x|=a[j++];
ans+=j-i-1;
x&=~a[i];
}
cout<<ans;
}

Compiler output:
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:8:7: note: in expansion of macro 'int'
    8 | const int N=2e5+100;
      |       ^~~
a.cc:8:11: error: 'N' does not name a type
    8 | const int N=2e5+100;
      |           ^
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:9:1: note: in expansion of macro 'int'
    9 | int a[N];
      | ^~~
a.cc:9:5: error: 'a' does not name a type
    9 | int a[N];
      |     ^
a.cc: In function 'int main()':
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:13:1: note: in expansion of macro 'int'
   13 | int n;
      | ^~~
a.cc:13:5: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 | int n;
      |     ^
      |     yn
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:15:5: note: in expansion of macro 'int'
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |     ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |         ^
a.cc:15:16: error: expected ')' before ';' token
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |    ~           ^
      |                )
a.cc:15:17: error: 'i' was not declared in this scope
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |                 ^
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:16:1: note: in expansion of macro 'int'
   16 | int ans=0;
      | ^~~
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 | int ans=0;
      |     ^~~
      |     abs
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:17:5: note: in expansion of macro 'int'
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |     ^~~
a.cc:17:13: error: 'j' was not declared in this scope; did you mean 'jn'?
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |             ^
      |             jn
a.cc:17:17: error: 'x' was not declared in this scope
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |                 ^
a.cc:17:24: error: expected ')' before ';' token
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |    ~                   ^
      |                        )
Language: C++

#include<bits/stdc++.h>

typedef long long ll;
#define int ll;

using namespace std;

const int N=2e5+100;
int a[N];

int main()
{
int n;
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
int ans=0;
for(int i=0,j=0,x=0;i<n;i++)
{
while(j<n&&!(x^a[j])) x|=a[j++];
ans+=j-i-1;
x&=~a[i];
}
cout<<ans;
}

Compiler output:
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:8:7: note: in expansion of macro 'int'
    8 | const int N=2e5+100;
      |       ^~~
a.cc:8:11: error: 'N' does not name a type
    8 | const int N=2e5+100;
      |           ^
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:9:1: note: in expansion of macro 'int'
    9 | int a[N];
      | ^~~
a.cc:9:5: error: 'a' does not name a type
    9 | int a[N];
      |     ^
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:11:1: note: in expansion of macro 'int'
   11 | int main()
      | ^~~
a.cc:11:5: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   11 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:13:1: note: in expansion of macro 'int'
   13 | int n;
      | ^~~
a.cc:13:5: error: 'n' was not declared in this scope; did you mean 'yn'?
   13 | int n;
      |     ^
      |     yn
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:15:5: note: in expansion of macro 'int'
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |     ^~~
a.cc:15:9: error: 'i' was not declared in this scope
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |         ^
a.cc:15:16: error: expected ')' before ';' token
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |    ~           ^
      |                )
a.cc:15:17: error: 'i' was not declared in this scope
   15 | for(int i=0;i<n;i++) cin>>a[i];
      |                 ^
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:16:1: note: in expansion of macro 'int'
   16 | int ans=0;
      | ^~~
a.cc:16:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 | int ans=0;
      |     ^~~
      |     abs
a.cc:4:13: error: declaration does not declare anything [-fpermissive]
    4 | #define int ll;
      |             ^~
a.cc:17:5: note: in expansion of macro 'int'
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |     ^~~
a.cc:17:13: error: 'j' was not declared in this scope; did you mean 'jn'?
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |             ^
      |             jn
a.cc:17:17: error: 'x' was not declared in this scope
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |                 ^
a.cc:17:24: error: expected ')' before ';' token
   17 | for(int i=0,j=0,x=0;i<n;i++)
      |    ~                   ^
      |                        )
Language: C++

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define INF 1e9
#define PI acos(-1)
typedef long long ll;


int main() {
	
	int n; cin >> n;
	vector<ll>a(n);
	for (int i = 0; i < n; i++)cin >> a[i];

	ll sum = 0, xor=0, ans = 0;
	int right = 0;

	for (int left = 0; left < n; left++) {
		while (right < n&&((sum + a[right]) == (xor^a[right]))) {
			sum += a[right];
			xor ^= a[right];
			right++;
		}

		ans += (right - left);

		if (right == left)right++;
		else {
			sum -= a[left];
			xor ^= a[left];
		}

	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: expected unqualified-id before 'xor' token
   32 |         ll sum = 0, xor=0, ans = 0;
      |                     ^~~
a.cc:36:57: error: expected primary-expression before 'xor' token
   36 |                 while (right < n&&((sum + a[right]) == (xor^a[right]))) {
      |                                                         ^~~
a.cc:36:60: error: expected primary-expression before '^' token
   36 |                 while (right < n&&((sum + a[right]) == (xor^a[right]))) {
      |                                                            ^
a.cc:38:25: error: expected primary-expression before 'xor' token
   38 |                         xor ^= a[right];
      |                         ^~~
a.cc:38:29: error: expected primary-expression before '^=' token
   38 |                         xor ^= a[right];
      |                             ^~
a.cc:42:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |                 ans += (right - left);
      |                 ^~~
      |                 abs
a.cc:47:25: error: expected primary-expression before 'xor' token
   47 |                         xor ^= a[left];
      |                         ^~~
a.cc:47:29: error: expected primary-expression before '^=' token
   47 |                         xor ^= a[left];
      |                             ^~
a.cc:52:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C

#include <stdio.h>

int main(){
  int N;
  scanf("%d", N);
  
  int i,j;
  int A[1048576+1];
  for(i = 1; i <= N; i++)
  	scanf(" %d", &A[i]);
  
  int r,l;
  int ans = 0;
  int check[32] = {0};
  
  for(l = 1; l <= N; l++){
   // 左固定
    for(r = l+1; r <= N; r++){
      	// 右固定
      	rhs = 0;
     	
       	// シフトで繰り上がり確認
      	for(i = 1; i <= 32; i++){
      		for(j = l; j <= r; j++){       		
          		A[j] >> i;
              
              	if((A[j]&1) == 1) // 最下位ビットが1なら
                	check[i] += 1;                                          
      		} 
          
          if((check[i] > 2)&& (check[i] % 2 == 1))
            break;          
      	}
      ans++;
    }
  }  
  
  printf("%d\n", ans);
 return 0; 
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: 'rhs' undeclared (first use in this function)
   20 |         rhs = 0;
      |         ^~~
main.c:20:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair <int, int>
#define int long long
#define sz(a) (int)(a.size()) 
#define resize(v) v.resize(unique(all(v)) - v.begin()); 
#define all(a) a.begin(), a.end()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it ++)

using namespace std;

void Fast_Read_Out()
{
	ios_base::sync_with_stdio(0);
	cin.tie(), cout.tie();
}

void Random()
{
	unsigned int seed;
	asm("rdtsc" : "=A" (seed));
	srand(seed);        
}

unsigned int Time()
{
	 unsigned int time = clock() / 1000.00;
	 return time;
}

const int inf = (1e9) + 123;
const int N = 2e5 + 123;
const int K = 21;

int pref[N], a[N], xorr[N];

int main ()
{
	#ifdef JUDGE
		freopen("input.txt", "r", stdin);
	#endif 
	Random();
	Fast_Read_Out();
	int n;
	cin >> n;
	for(int i = 1; i <= n; i++) cin >> a[i], pref[i] = pref[i - 1] + a[i], xorr[i] = (xorr[i - 1] ^ a[i]);
	int res = 0;
	for(int i = 1; i <= n; i++)
	{
		int l = i, r = n;
		while(l + 1 < r)
		{
			int mid = l + r >> 1;
			if(pref[mid] - pref[i - 1] == (xorr[mid] ^ xorr[i - 1])) l = mid;
			else r = mid;
		}
		if(pref[r] - pref[i - 1] == (xorr[r] ^ xorr[i - 1])) res += (r - i + 1);
		else res += (l - i + 1);
	}
	cout << res << endl;
	#ifdef JUDGE
//		cout << Time() << endl;
	#endif
}
// Easy Peasy Lemon Squeezy

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <vector>
#include <sstream>
#include <bitset>

std::string two (long long x ) {
  std::stringstream ss;
  ss << static_cast<std::bitset<22> >(x);
  std::string x_bin = ss.str();
  return x_bin;  
}

int main () {
  long long N;
  std::cin >> N;
  std::vector<long long> A(N);
  std::vector<std::string> x(N);
  
  // 数字を2進数表示させる.
  for (long long i = 0; i < N; i++) {
    std::cin >> A[i];
    x[i] = two(A[i]);
  }

  // 2進数表示させた数字に対して, 足し算することができるか検証する.
  long long answer = N;
  bool forBool = false;
  bool forBoolfor = false;
\
  std::vector<int> iterator(22);
  for (int i = 0; i < 22; i++) {
    iterator[i] = 0;  
  }
  long long iterator_number = 1;

  // lをあえて0のみで考える.
  for (long long l = 0; l < N - 1; l++) {
    forBool = false;
    forBoolfor = false;
    iterator_number = (iterator_number > l) ? iterator_number: l + 1;

    if (l > 0 && iterator_number != (l + 1) ) {
      for (int q = 0; q < 22; q++) {
        if (x[l-1][q] == '2' && x[l][q] == '0') {
          x[l][q] = '2';  
        }  
      }
    }

    for (long long r = iterator_number; r < N; r++) {
      
      
      for (int i = 0; i < 22; i++) {
        if (x[l][i] >= '1' && x[r][i] >= '1') {
          
          // l = 0 とrではxorにはならないという意味.
          forBool = true;
        }

        if (forBool == true) {
          break;  
        }
        
        // 比較した位について1があったら1にする.
        if (x[l][i] == '0' && x[r][i] == '1') {
          x[l][i] = '3';  
        }
        
      }

      for (int i = 0; i < 22; i++) {
        if (forBool == true) {
          if (x[l][i] == '3'){
            x[l][i] = '0';  
          }  
        }
        else {
          if (x[l][i] == '3') {
            x[l][i] = '2';  
          }  
        }  
      }

      if (forBool == true) {

        // まずは隣り合わせの時
        if (iterator_number == (r - 1) ) {
          answer = answer + 1;
          if (l == 0) {
            iterator_number = r;
          }
        }
        else {
            answer = answer + (r - iterator_number)*(r - iterator_number + 1) / 2;  
            iterator_number = r;
        }


        break;
      }
      
      if (r == N - 1 ) {
        answer = answer + (r + 1 - l) * (r - l ) / 2; 
        forBoolfor = true;
      }
      if (forBoolfor) {
        break;  
      }
    }  
    if (forBoolfor) {
      break;  
    }
  }

  std::cout << answer 
}


Compiler output:
a.cc: In function 'int main()':
a.cc:115:22: error: expected ';' before '}' token
  115 |   std::cout << answer
      |                      ^
      |                      ;
  116 | }
      | ~
Language: C++

#include<bits/stdc++.h>

using namespace std;
const int nmax = 2e5 + 100;
int a[nmax];
int main() {
//    freopen("in.txt","r",stdin);
    int n; scanf("%d", &n);
    int l = 1;
    ll ans = 0, sum = 0;
    for(int r = 1; r <= n; r++){
        scanf("%d", &a[r]);
        while((sum ^ a[r]) != sum + a[r]) sum ^= a[l], l++;
        sum ^= a[r];
        ans += (r - l + 1);
    }
    printf("%lld\n", ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'll' was not declared in this scope; did you mean 'l'?
   10 |     ll ans = 0, sum = 0;
      |     ^~
      |     l
a.cc:13:16: error: 'sum' was not declared in this scope
   13 |         while((sum ^ a[r]) != sum + a[r]) sum ^= a[l], l++;
      |                ^~~
a.cc:14:9: error: 'sum' was not declared in this scope
   14 |         sum ^= a[r];
      |         ^~~
a.cc:15:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         ans += (r - l + 1);
      |         ^~~
      |         abs
a.cc:17:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     printf("%lld\n", ans);
      |                      ^~~
      |                      abs
Language: C++

#include <iostream>
using namespace std;

int main()
{
	int n=0,ans=0;
  cin >> n;
  int a[n];
  for(int i=0;i<n;++i){
    cin >> a[i];
  }//ここまで入力処理
  int bef_r=0;
  int xo=0,sum=0;//xorとsumの変数を確保
  int bef_x=0,bef_sum=0;
  for(int l=0;l<n;++l){
    x = bef_x;
    sum = bef_sum;
    if(bef_r<l){
      bef_r = l;
    }
    for(int r=bef_r;r<n;++r){
      bef_x = xo;
      bef_sum = sum;
      xo ^=a[r];
      sum += a[r];
      if(xo != sum){
        bef_r = r-1;
        ans += bef_r - l + 1;
        break;
      }
    }
    bef_x ^= a[l];
    bef_sum -= a[l];
  }
  cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'x' was not declared in this scope
   16 |     x = bef_x;
      |     ^
Language: C

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;

#define ll long long

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}

int main() {

	ll N, ans;
	vector<ll> A, csum, xsum;

	cin >> N;
	ans = N;
	A.push_back(0);
	csum.push_back(0);
	xsum.push_back(0);
	for (ll i = 1; i <= N; i++) {

		ll tmp;
		cin >> tmp;
		A.push_back(tmp);
		csum.push_back(csum[i - 1] + tmp);
		xsum.push_back(xsum[i - 1] ^ tmp);

	}

	for (ll i = 2; i <= N; i++) {

		for (ll j = i; j <= N; j++) {

			if ((csum[j] - csum[j - i]) == (xsum[j] ^ xsum[j - i])) {

				//cout << i << " " << j << " " << csum[j] - csum[j - i] << " " << (xsum[j] ^ xsum[j - i]) << endl;
				ans++;

			}

		}

	}

	cout << ans << endl;

	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<unsigned> A(N);
  for(int i = 0; i < N; i++) cin >> A[i];
  
  int ans = 0;
  unsigned xor = 0;
  for(int l = 0, r = 0; l < N; l++) {
  	while(r < N && xor & A[r] == 0) {
      xor ^= A[r];
      r++;
    }
    ans += r - l;
    xor = xor & (~A[l]);
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected unqualified-id before 'xor' token
   13 |   unsigned xor = 0;
      |            ^~~
a.cc:15:24: error: expected primary-expression before 'xor' token
   15 |         while(r < N && xor & A[r] == 0) {
      |                        ^~~
a.cc:16:7: error: expected primary-expression before 'xor' token
   16 |       xor ^= A[r];
      |       ^~~
a.cc:16:11: error: expected primary-expression before '^=' token
   16 |       xor ^= A[r];
      |           ^~
a.cc:20:5: error: expected primary-expression before 'xor' token
   20 |     xor = xor & (~A[l]);
      |     ^~~
a.cc:20:9: error: expected primary-expression before '=' token
   20 |     xor = xor & (~A[l]);
      |         ^
a.cc:20:11: error: expected primary-expression before 'xor' token
   20 |     xor = xor & (~A[l]);
      |           ^~~
a.cc:20:18: error: lvalue required as unary '&' operand
   20 |     xor = xor & (~A[l]);
      |                 ~^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
short ONE_OR_ZERO[200005][25]={0};
int t[25];
int a[200005];
long long n,s,tot=0;
bool flag;
void TWO(int num,int x){
	for(int tot=1;i<=25;tot++){
		ONE_OR_ZERO[num][tot]=ONE_OR_ZERO[num-1][tot];
	}
	int tot=0;
	while(x>0){
		tot++;
		ONE_OR_ZERO[num][tot]=ONE_OR_ZERO[num-1][tot]+x%2;
		x=x>>1;
	}
}
int main(){
	scanf("%lld",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		TWO(i,a[i]);
	}
	for(int l=1;l<=n-1;l++){
		for(int r=l+1;r<=n;r++){
			flag=0;
			for(int i=1;i<=25;i++){
				t[i]=ONE_OR_ZERO[r][i]-ONE_OR_ZERO[l-1][i];
				if(t[i]==0||t[i]==1){
					flag=flag;
				}else{
					flag=1;
				}
			}
		}
		if(!flag){
			tot++;
		}
	}
	printf("%d",tot+n);
	return 0;
}

Compiler output:
a.cc: In function 'void TWO(int, int)':
a.cc:9:23: error: 'i' was not declared in this scope
    9 |         for(int tot=1;i<=25;tot++){
      |                       ^