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

#include<iostream>
#include<string>
#include<complex>
#include<vector>
#include<algorithm>
#include<functional>
#include<array>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;


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

	ull ans = 0;
	ull x=0,y=0;
	for (int i = 0,j=0;j < n;) {
		while(((x+a[i)]==(y^a[i]))&&(i<n)){
			x += a[i];
			y ^= a[i];
			i++;
		}
		ans += (i - j);
		x -= a[j];
		y ^= a[j];
		j++;
	
	}

	cout << ans << endl;



	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:30: error: expected ']' before ')' token
   24 |                 while(((x+a[i)]==(y^a[i]))&&(i<n)){
      |                              ^
      |                              ]
a.cc:24:31: error: expected ')' before ']' token
   24 |                 while(((x+a[i)]==(y^a[i]))&&(i<n)){
      |                       ~       ^
      |                               )
a.cc:28:18: error: expected ')' before 'ans'
   28 |                 }
      |                  ^
      |                  )
   29 |                 ans += (i - j);
      |                 ~~~
a.cc:24:22: note: to match this '('
   24 |                 while(((x+a[i)]==(y^a[i]))&&(i<n)){
      |                      ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<int> a(N);

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

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

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

	cout << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: expected unqualified-id before 'xor' token
   19 |         int xor = 0;
      |             ^~~
a.cc:22:39: error: expected primary-expression before 'xor' token
   22 |                 while (right < N && ((xor ^ a[right]) == (sum + a[right]))){
      |                                       ^~~
a.cc:22:43: error: expected primary-expression before '^' token
   22 |                 while (right < N && ((xor ^ a[right]) == (sum + a[right]))){
      |                                           ^
a.cc:24:25: error: expected primary-expression before 'xor' token
   24 |                         xor ^= a[right];
      |                         ^~~
a.cc:24:29: error: expected primary-expression before '^=' token
   24 |                         xor ^= a[right];
      |                             ^~
a.cc:34:25: error: expected primary-expression before 'xor' token
   34 |                         xor ^= a[left];
      |                         ^~~
a.cc:34:29: error: expected primary-expression before '^=' token
   34 |                         xor ^= a[left];
      |                             ^~
Language: C++

#include<stdio.h> 
#include <iostream>
#include <algorithm>
#include<string>
#include<string.h>
#include<math.h>
/****  STL  ****/
#include<vector>
#include<queue>
#include<unordered_map>
#include<unordered_set>

#define uint unsigned int
#define ll long long
#define kMin -1
using namespace std;

const int kMax = 2e5 + 5;
const int kInf = 1e9;

int nums[kMax];
int n;
bool vis[21];
int st = 0, ed = 1;
int main()
{
	while (~scanf("%d", &n))
	{
		/***init****/
		ed = 1, st = 0;
		memset(vis, 0, sizeof(vis));
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &nums[i]);
		}
		int ans = 0;

		for (int s = 0; s <= 20; s++)
		{
			if ((nums[0] >> s) & 1)vis[s] = true;
		}
		//		for (int i = 1; i < n; i++)
		while (ed < n)
		{
			bool flag = true;
			for (int s = 0; s < =20 && flag; s++)
			{
				if ((nums[ed] >> s) & 1)
				{
					if (vis[s])
						flag = false;
				}
			}
			if (!flag) {
				ans += (ed - st);
				for (int s = 0; s <= 20; s++)
				{
					if ((nums[st] >> s) & 1)vis[s] = false;
				}
				st++;
//				if (st == ed)ed++;
			}
			else
			{
				for (int s = 0; s < =20; s++)
				{
					if ((nums[ed] >> s) & 1)vis[s] = true;
				}
				ed++;
			}
		}
		for (int i = 1; i <= (ed - st); i++) {
			ans += i;
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:45: error: expected primary-expression before '=' token
   46 |                         for (int s = 0; s < =20 && flag; s++)
      |                                             ^
a.cc:65:53: error: expected primary-expression before '=' token
   65 |                                 for (int s = 0; s < =20; s++)
      |                                                     ^
Language: C++

#include<stdio.h> 
#include <iostream>
#include <algorithm>
#include<string>
#include<string.h>
#include<math.h>
/****  STL  ****/
#include<vector>
#include<queue>
#include<unordered_map>
#include<unordered_set>

#define uint unsigned int
#define ll long long
#define kMin -1
using namespace std;

const int kMax = 2e5 + 5;
const int kInf = 1e9;

int nums[kMax];
int n;
bool vis[21];
int st = 0, ed = 1;
int main()
{
	while (~scanf("%d", &n))
	{
		/***init****/
		ed = 1, st = 0;
		memset(vis, 0, sizeof(vis));
		for (int i = 0; i < n; i++)
		{
			scanf("%d", &nums[i]);
		}
		int ans = 0;

		for (int s = 0; s < 20; s++)
		{
			if ((nums[0] >> s) & 1)vis[s] = true;
		}
		//		for (int i = 1; i < n; i++)
		while (ed < n)
		{
			bool flag = true;
			for (int s = 0; s < 20 && flag; s++)
			{
				if ((nums[ed] >> s) & 1)
				{
					if (vis[s])
						flag = false;
				}
			}
			if (!flag) {
				ans += (ed - st);
				for (int s = 0; s < ＝20; s++)
				{
					if ((nums[st] >> s) & 1)vis[s] = false;
				}
				st++;
//				if (st == ed)ed++;
			}
			else
			{
				for (int s = 0; s < 20; s++)
				{
					if ((nums[ed] >> s) & 1)vis[s] = true;
				}
				ed++;
			}
		}
		for (int i = 1; i <= (ed - st); i++) {
			ans += i;
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:53: error: '\U0000ff1d20' was not declared in this scope
   56 |                                 for (int s = 0; s < ＝20; s++)
      |                                                     ^~~~
Language: C++

#include<stdio.h> 
#include <iostream>
#include <algorithm>
#include<string>
#include<string.h>
#include<math.h>
/****  STL  ****/
#include<vector>
#include<queue>
#include<unordered_map>
#include<unordered_set>

#define uint unsigned int
#define ll long long
#define kMin -1
using namespace std;

const int kMax = 2e5 + 5;
const int kInf = 1e9;
#define ws  21;

int nums[kMax];
int n;
bool vis[21];
int st = 0, ed = 1;
int main()
{
	while (~scanf("%d", &n))
	{
		/***init****/
		ed = 1, st = 0;
		memset(vis, 0, sizeof(vis));

		for (int i = 0; i < n; i++)
		{
			scanf("%d", &nums[i]);
		}
		int ans = 0;

		for (int s = 0; s < 20; s++)
		{
			if ((nums[0] >> s) & 1)vis[s] = true;
		}
		while (ed < n)
		{
			bool flag = true;
			for (int s = 0; s < ws && flag; s++)
			{
				if ((nums[ed] >> s) & 1)
				{
					if (vis[s])
						flag = false;
				}
			}
			if (!flag) {
				ans += (ed - st);
				for (int s = 0; s < ws; s++)
				{
					if ((nums[st] >> s) & 1)vis[s] = false;
				}
				st++;
			}
			else
			{
				for (int s = 0; s < ws; s++)
				{
					if ((nums[ed] >> s) & 1)vis[s] = true;
				}
				ed++;
			}
		}
		for (int i = 1; i <= (ed - st); i++) {
			ans += i;
		}
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:55: error: expected ')' before ';' token
   47 |                         for (int s = 0; s < ws && flag; s++)
      |                             ~                         ^
      |                                                       )
a.cc:47:57: error: 's' was not declared in this scope; did you mean 'st'?
   47 |                         for (int s = 0; s < ws && flag; s++)
      |                                                         ^
      |                                                         st
a.cc:57:55: error: expected primary-expression before ';' token
   57 |                                 for (int s = 0; s < ws; s++)
      |                                                       ^
a.cc:57:55: error: expected ')' before ';' token
   57 |                                 for (int s = 0; s < ws; s++)
      |                                     ~                 ^
a.cc:65:55: error: expected primary-expression before ';' token
   65 |                                 for (int s = 0; s < ws; s++)
      |                                                       ^
a.cc:65:55: error: expected ')' before ';' token
   65 |                                 for (int s = 0; s < ws; s++)
      |                                     ~                 ^
a.cc:47:51: error: label 'flag' used but not defined
   47 |                         for (int s = 0; s < ws && flag; s++)
      |                                                   ^~~~
Language: Java

public class Main {

	public static void main(String[] args) {
		Solve s = new Solve();
		s.solve();
	}

}

class Solve {

	// 標準入力用
	Scanner sc;

	public Solve() {
		sc = new Scanner(System.in);
	}

	public void solve() {
		int N = sc.nextInt();
		int[] A = new int[N];
		int counter = 0;

		for (int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}

		for (int l = 0, r = 0; l <=r ; l++) {
			for (r = l; r < N; r++) {
				if (add(l, r, A) == xor(l, r, A)) {
//					System.out.println(add(l, r, A) +" : " + xor(l, r, A) + " l, r " + l + " " + r);
					counter++;
				}
			}
		}

		// 出力。
		System.out.println(counter);

	}

	public int add (int left, int right, int[] t) {
		int result = 0;
		for (int i = left; i < right + 1; i++) {
			result += t[i];
		}
		return result;
	}

	// xorは結合法則が成り立つ。
	public int xor(int left, int right, int[] t) {
		int result = 0;
		for (int i = left; i < right + 1; i++) {
			result ^= t[i];
		}
		return result;
	}
}


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

#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#define pb push_back 
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
const double pi = 3.14159265;
const ll LLINF = 1LL << 50;
using namespace std;


int main() {
    int n, a[200005];
    cin >> n;
    for (int i = 0; i < n; i++)cin >> a[i];
    int r = 0, nowsum = 0, nowxor = 0
    ll ans = 0;
    for (int l = 0; l < n; l++) {
        while (r < n && (nowsum + a[r]) == (nowxor^a[r])) {
            nowsum = nowsum + a[r];
            nowxor = nowxor^a[r];
            r++;
        }
        ans += r - l;
        nowsum -= a[l];
        nowxor ^= a[l];
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:5: error: expected ',' or ';' before 'll'
   35 |     ll ans = 0;
      |     ^~
a.cc:42:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   42 |         ans += r - l;
      |         ^~~
      |         abs
a.cc:46:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C

#include <stdio.h>
int abc098d(){
    int n;
    scanf("%d",&n);

    int i;
    int a[200000];
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    long long cnt=0;
    int sum=0;
    int l=0,r=0;
    while(l<n){
        while(r<n && (sum&a[r])==0){
                cnt+=r-l+1;
                sum+=a[r++];
        }
        sum-=a[l++];
    }
    printf("%lld\n",cnt);
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <tuple>
#include <string>
#include <iterator>
#include <regex>
using namespace std;

#define MAX_N 200000

int main()
{
    int N;
    cin >> N;
    int A[MAX_N];
    pair<int, int> tt[MAX_N];
    return 0;
    for (int i = 0; i < N; i++) {
        int Ai;
        cin >> Ai;
        A[i] = Ai;
    }
    cout << "DEBUG";
    int rt = 0;
    for (int l = 0; l < N; l++) {
        for (int r = l; r < N; r++) {
            if (l == r) {
                tt[l][l] = make_pair(A[l], A[l]);
            } else {
                tt[l][r] = make_pair(tt[l][r - 1].first + A[r], tt[l][r - 1].second ^ A[r]);
            }
            if (tt[l][r].first == tt[l][r].second) {
                rt++;
            }
        }
    }
    cout << rt << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:22: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   39 |                 tt[l][l] = make_pair(A[l], A[l]);
      |                      ^
a.cc:41:22: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   41 |                 tt[l][r] = make_pair(tt[l][r - 1].first + A[r], tt[l][r - 1].second ^ A[r]);
      |                      ^
a.cc:41:43: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   41 |                 tt[l][r] = make_pair(tt[l][r - 1].first + A[r], tt[l][r - 1].second ^ A[r]);
      |                                           ^
a.cc:41:70: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   41 |                 tt[l][r] = make_pair(tt[l][r - 1].first + A[r], tt[l][r - 1].second ^ A[r]);
      |                                                                      ^
a.cc:43:22: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   43 |             if (tt[l][r].first == tt[l][r].second) {
      |                      ^
a.cc:43:40: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
   43 |             if (tt[l][r].first == tt[l][r].second) {
      |                                        ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <algorithm>
#include <vector>
#include <utility>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <tuple>
#include <string>
#include <iterator>
#include <regex>
using namespace std;

int main()
{
    int N;
    cin >> N;
    int A[N];
    pair<int, int> tt[N][N];
    for (int i = 0; i < N; i++) {
        int Ai;
        cin >> Ai;
        A[i] = Ai
    }
    int rt = 0;
    for (int l = 0; l < N; l++) {
        for (int r = l; r < N; r++) {
            if (l == r) {
                tt[l][l] = make_pair(A[l], A[l]);
            } else {
                tt[l][r] = make_pair(tt[l][r - 1].first + A[r], tt[l][r - 1].second ^ A[r]);
            }
            if (tt[l][r].first == tt[l][r].second) {
                rt++;
            }
        }
    }
    cout << rt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: expected ';' before '}' token
   29 |         A[i] = Ai
      |                  ^
      |                  ;
   30 |     }
      |     ~
Language: C++

#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<int> A(N);
	for(int i=0; i<N; i++)
		cin >> A[i];

	int xor, sum;
	xor = sum = 0;
	long long ret = 0;
	for(int l=0, r=0; l<N; l++){
		while(r<N && (sum+A[r] == (xor^A[r]))){
			sum += A[r];
			xor ^= A[r];
			r++;
		}
		//cout << l << " : " << r << " " << sum << " " << xor << endl;

		ret += r - l;
		sum -= A[l];
		xor ^= A[l];
	}

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected unqualified-id before 'xor' token
   16 |         int xor, sum;
      |             ^~~
a.cc:17:9: error: expected primary-expression before 'xor' token
   17 |         xor = sum = 0;
      |         ^~~
a.cc:17:13: error: expected primary-expression before '=' token
   17 |         xor = sum = 0;
      |             ^
a.cc:17:15: error: 'sum' was not declared in this scope
   17 |         xor = sum = 0;
      |               ^~~
a.cc:20:44: error: expected primary-expression before 'xor' token
   20 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                            ^~~
a.cc:20:47: error: expected primary-expression before '^' token
   20 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                               ^
a.cc:22:25: error: expected primary-expression before 'xor' token
   22 |                         xor ^= A[r];
      |                         ^~~
a.cc:22:29: error: expected primary-expression before '^=' token
   22 |                         xor ^= A[r];
      |                             ^~
a.cc:29:17: error: expected primary-expression before 'xor' token
   29 |                 xor ^= A[l];
      |                 ^~~
a.cc:29:21: error: expected primary-expression before '^=' token
   29 |                 xor ^= A[l];
      |                     ^~
Language: C++

#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<int> A(N);
	for(int i=0; i<N; i++)
		cin >> A[i];

	int xor=0, sum=0;
	long long ret = 0;
	for(int l=0, r=0; l<N; l++){
		while(r<N && (sum+A[r] == (xor^A[r]))){
			sum += A[r];
			xor ^= A[r];
			r++;
		}
		//cout << l << " : " << r << " " << sum << " " << xor << endl;

		ret += r - l;
		sum -= A[l];
		xor ^= A[l];
	}

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected unqualified-id before 'xor' token
   16 |         int xor=0, sum=0;
      |             ^~~
a.cc:19:31: error: 'sum' was not declared in this scope
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                               ^~~
a.cc:19:44: error: expected primary-expression before 'xor' token
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                            ^~~
a.cc:19:47: error: expected primary-expression before '^' token
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                               ^
a.cc:21:25: error: expected primary-expression before 'xor' token
   21 |                         xor ^= A[r];
      |                         ^~~
a.cc:21:29: error: expected primary-expression before '^=' token
   21 |                         xor ^= A[r];
      |                             ^~
a.cc:27:17: error: 'sum' was not declared in this scope
   27 |                 sum -= A[l];
      |                 ^~~
a.cc:28:17: error: expected primary-expression before 'xor' token
   28 |                 xor ^= A[l];
      |                 ^~~
a.cc:28:21: error: expected primary-expression before '^=' token
   28 |                 xor ^= A[l];
      |                     ^~
Language: C++

#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N;
	cin >> N;

	vector<int> A(N);
	for(int i=0; i<N; i++)
		cin >> A[i];

	int  xor=0, sum=0;
	long long ret = 0;
	for(int l=0, r=0; l<N; l++){
		while(r<N && (sum+A[r] == (xor^A[r]))){
			sum += A[r];
			xor ^= A[r];
			r++;
		}
		//cout << l << " : " << r << " " << sum << " " << xor << endl;

		ret += r - l;
		sum -= A[l];
		xor ^= A[l];
	}

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected unqualified-id before 'xor' token
   16 |         int  xor=0, sum=0;
      |              ^~~
a.cc:19:31: error: 'sum' was not declared in this scope
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                               ^~~
a.cc:19:44: error: expected primary-expression before 'xor' token
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                            ^~~
a.cc:19:47: error: expected primary-expression before '^' token
   19 |                 while(r<N && (sum+A[r] == (xor^A[r]))){
      |                                               ^
a.cc:21:25: error: expected primary-expression before 'xor' token
   21 |                         xor ^= A[r];
      |                         ^~~
a.cc:21:29: error: expected primary-expression before '^=' token
   21 |                         xor ^= A[r];
      |                             ^~
a.cc:27:17: error: 'sum' was not declared in this scope
   27 |                 sum -= A[l];
      |                 ^~~
a.cc:28:17: error: expected primary-expression before 'xor' token
   28 |                 xor ^= A[l];
      |                 ^~~
a.cc:28:21: error: expected primary-expression before '^=' token
   28 |                 xor ^= A[l];
      |                     ^~
Language: C++

#include <bits/stdc++.h>
 
using namespace std;
 
int N;
vector<int> A;

int main(void){
    
    cin >> N;
    
    for(int i = 0; i < N; ++i){
        int n;
        cin >> n;
        A.push_back(n);
    }
    
    int j = 0, nsum = 0, bsum = 0;
    long long result = 0
    for(int i = 0; i < N; ++i){
        while(j < N && (bsum ^ A[j]) == (nsum + A[j])){
            bsum ^= A[j];
            nsum += A[j];
            ++j;
        }
        result += j - i;
        bsum ^= A[i];
        nsum -= A[i];
    }
    
    cout << result << endl;
    
    return 0;
}

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

#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int n,s[300010],a[300010],ans,x;
int main(){
cin>>n;
for (int i=1;i<=n;i++){
cin>>x;
s[i]=s[i-1]+x;
a[i]=a[i-1]^x;
}
int l=1;
for (int r=1;r<=n;r++){
for (;(s[r]-s[l-1])!=(a[r]^a[l-1]);l++)；
ans+=r-l+1;
}
cout<<ans<<endl;
system("pause");
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:40: error: '\U0000ff1b' was not declared in this scope
   24 | for (;(s[r]-s[l-1])!=(a[r]^a[l-1]);l++)；
      |                                        ^~
Language: C++

int main(){
    long long n,ans=0;
    int a[2000005];

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

    int r=0;
    for(int l=0;l<n;l++){
        while(r<n){
            if((xsum ^ a[r])!=(sum + a[r]))break;
            xsum=(a[r] ^ xsum);
            sum+=a[r];
            r++;
        }
        ans+=(r-l);
        xsum^=a[l];
        sum-=a[l];
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin>>n;
      |     ^~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout<<ans<<endl;
      |     ^~~~
a.cc:23:16: error: 'endl' was not declared in this scope
   23 |     cout<<ans<<endl;
      |                ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include <unordered_map>

size_t A[200000];
int main(void) {
  int n;

  std::cin >> n; /* 1 to 3*10^5 */

  //int* A = new int[n];
  for (size_t i = 0; i < n; i++) {
    std::cin >> A[i];
  }

  size_t count = 0;

  size_t lsum = 0;
  size_t rsum = 0;
  size_t lsum_, rsum_;
  size_t offset = 0;
  size_t i = 0;
  while(i < n) {
    size_t lcount = 0;
    for (size_t j = i + offset; j < n; ++j) {
      lsum_ = lsum ^ A[j];
      rsum_ = rsum + A[j];
      if (l != r) {
        break;
      }

      lcount++;
      lsum = l;
      rsum = r;
    }

    count += lcount + offset;
    if (offset) {
      --offset;
    }
    offset += lcount;
    lsum ^= A[i];
    rsum -= A[i];
    ++i;
  }

  std::cout << count << std::endl;;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:11: error: 'l' was not declared in this scope
   29 |       if (l != r) {
      |           ^
a.cc:29:16: error: 'r' was not declared in this scope
   29 |       if (l != r) {
      |                ^
a.cc:34:14: error: 'l' was not declared in this scope
   34 |       lsum = l;
      |              ^
a.cc:35:14: error: 'r' was not declared in this scope
   35 |       rsum = r;
      |              ^
Language: C++

n = int(input())
A = list(map(int, input().split()))
ans = 0
s = 0
j = 0
for i in range(n):
    while j < n and not (s & A[j]):
        s ^= A[j]
        j += 1
    ans += j-i
    s ^= A[i]
print(ans)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    int a[n];
    for (int i = 0; i < n; i++) scanf("%d",&a[i]);
    int ans = 0;
    int j = 0;
    int s = 0;
    for (int i = 0; i < n; i++)
    {
        while (j < n && !(s & a[j]))
        {
            s = s ^ a[j];
            j++;
        }
        ans += j - i;
        s ^= a[i]
    }
    printf("%d\n", r);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:18: error: expected ';' before '}' token
   20 |         s ^= a[i]
      |                  ^
      |                  ;
   21 |     }
      |     ~             
a.cc:22:20: error: 'r' was not declared in this scope
   22 |     printf("%d\n", r);
      |                    ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    scanf("%d",&n);
    int a[n];
    for (int i = 0; i < N; i++) scanf("%d",&a[i]);
    int ans = 0;
    int j = 0;
    int s = 0;
    for (int i = 0; i < N; i++)
    {
        while (j < N && !(p & a[j]))
        {
            s = s ^ a[j];
            j++;
        }
        ans += j - i;
        s ^= a[i]
    }
    printf("%d\n", r);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: 'N' was not declared in this scope
    8 |     for (int i = 0; i < N; i++) scanf("%d",&a[i]);
      |                         ^
a.cc:12:25: error: 'N' was not declared in this scope
   12 |     for (int i = 0; i < N; i++)
      |                         ^
a.cc:14:27: error: 'p' was not declared in this scope
   14 |         while (j < N && !(p & a[j]))
      |                           ^
a.cc:20:18: error: expected ';' before '}' token
   20 |         s ^= a[i]
      |                  ^
      |                  ;
   21 |     }
      |     ~             
a.cc:22:20: error: 'r' was not declared in this scope
   22 |     printf("%d\n", r);
      |                    ^
Language: C++

#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<set>
#include<iostream>
#include<stdlib.h>
using namespace std;
typedef long long ll;

int main() {
	ll N,num=0,sum=0,xor=0;
	cin >> N;
	ll* A = (ll*)malloc(sizeof(ll)*N);
	for (ll i = 0;i < N;i++)cin >> A[i];

	for (int l = 0;l < N;l++) {
		sum = 0;
		xor = 0;
		for (int r = l;r < N;r++) {
			sum += A[r];
			xor ^= A[r];
			if (sum == xor)num++;
		}
	}
	cout << num << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected unqualified-id before 'xor' token
   12 |         ll N,num=0,sum=0,xor=0;
      |                          ^~~
a.cc:19:17: error: expected primary-expression before 'xor' token
   19 |                 xor = 0;
      |                 ^~~
a.cc:19:21: error: expected primary-expression before '=' token
   19 |                 xor = 0;
      |                     ^
a.cc:22:25: error: expected primary-expression before 'xor' token
   22 |                         xor ^= A[r];
      |                         ^~~
a.cc:22:29: error: expected primary-expression before '^=' token
   22 |                         xor ^= A[r];
      |                             ^~
a.cc:23:36: error: expected primary-expression before 'xor' token
   23 |                         if (sum == xor)num++;
      |                                    ^~~
a.cc:23:39: error: expected primary-expression before ')' token
   23 |                         if (sum == xor)num++;
      |                                       ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    int a[N];
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    int r = 0;
    for (int i = 0; i < N; i++) {
        int p = 0;
        for (int j = i; j < N; j++) {
            if(x & a[j]==0){
                p = p ^ a[j];
                r++;
            }else{
                break;
            }
        }
    }
    printf("%d\n", r);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: 'x' was not declared in this scope
   14 |             if(x & a[j]==0){
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    int a[N];
    for (int i = 0; i < N; i++) {
        cin >> a[i];
    }
    int r = 0;
    for (int i = 0; i < N; i++) {
        int p = 0;
        for (int j = i; j < N; j++) {
            if(p + a[j]==p=p ^ a[j]){
                r++;
            }else{
                break;
            }
        }
    }
    printf("%d\n", r);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: lvalue required as left operand of assignment
   14 |             if(p + a[j]==p=p ^ a[j]){
      |                ~~~~~~~~^~~
Language: C++

# coding: utf-8

n = int(input())
a = [int(x) for x in input().split()]

count = 0

for i in range(0, n):
    if not result_bool:
        result_bool = True
        continue
    for j in range(i, n):
        xor_result = 0
        sum_result = 0
        result_bool = True
        for x in a[i:j+1]:
            if sum_result & x != 0:
                result_bool = False
                break
            xor_result ^= x
            sum_result += x
        if not result_bool:
            break
        if xor_result == sum_result and result_bool:
            count += 1

print(count)

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #coding
    1 | # coding: utf-8
      |   ^~~~~~
a.cc:3:1: error: 'n' does not name a type
    3 | n = int(input())
      | ^
Language: C++

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

int n;
int A[200000];
int B[200000];

int facctorial(int k) {
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum += i;
    }
    return sum;
}

int main() {
    scanf("%d", &n);
    for ( int i = 0; i < n; i++ ) {
        scanf("%d", &A[i]);
    }

    int res = 0;
    int temp;

    int sum_temp = 0;
    int xor_temp = 0;

    int j = 0;
    int i = 0
    for ( i = 0; i < n; i++ ) {
        sum_temp += A[i];
        xor_temp ^= A[i];
        if (sum_temp != xor_temp) {
            sum_temp = 0;
            xor_temp = 0;
            res += facctorial(i - j);
            j = i + 1;
            printf("%d %d\n", i, j);
        }
    }

    res += facctorial(i - j);

    // for ( int i = 0; i < n; i++ ) {
    //     temp = A[i];
    //     res += 1;
    //     for ( int j = i + 1; j < n; j++ ) {
    //         if ((temp + A[j]) != (temp ^ A[j])) {
    //             break;
    //         }
    //         temp += A[j];
    //         res += 1;
    //     }
    // }


    printf("%d\n", res);
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: expected ',' or ';' before 'for'
   32 |     for ( i = 0; i < n; i++ ) {
      |     ^~~
a.cc:32:28: error: expected ';' before ')' token
   32 |     for ( i = 0; i < n; i++ ) {
      |                            ^~
      |                            ;
Language: C++


#include <algorithm>  //min, max, sort, unique, fiint
#include <iostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>  //pair, swap,
#include <vector>

#define REP(i, n) for (int i = 0; i < (n); i++)
using namespace std;
// typedef long long int;

vector<int> vi;
vector<int> vinew;
queue<int> qi;
queue<int> qn;

int main() {
  int n;
  cin.tie(0);
  ios::sync_with_stdio(false);

  int temp;
  int count = 0;
  cin >> n;
  queue<int> *pn = &qn;
  queue<int> *pi = &qi;
  queue<int> *pt;
  int add, xo;
  int nn = 0;
  REP(i, n) {
    cin >> temp;
    // cerr << "read:" << temp << endl;
    pt = pn;
    pn = pi;
    pi = pt;
    nn = (*pi).size();
    while((*pi.size())) {
      add = (*pi).front() + temp;
      xo = (*pi).front() ^ temp;
      (*pi).pop();
      if (xo == add) {
        (*pn).push(xo);
        count++;
      }
    }
    (*pn).push(temp);
    count++;
  }
  cout << count << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: request for member 'size' in 'pi', which is of pointer type 'std::queue<int>*' (maybe you meant to use '->' ?)
   40 |     while((*pi.size())) {
      |                ^~~~
Language: C++

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

long long a[200005];
long long s[200005]={0};

int main(){
  int i,j,next=2,k;
  long long now=0,co=0,n;
  cin >> n;
  for(i=1;i<=n;i++){
    cin >> a[i];
    s[i]=s[i-1]+a[i];
  }
  for(i=1;i<=n;i++){
    now=a[i];
    for(j=max(next,i+1);j<=n;j++){
      if(j==max(next,i+1){
	  for(k=i+1;k<=j;k++)now =now^a[k];
	}
	else now = now^a[j];
	if(now==s[j]-s[i-1])co+=j-i;
	else {
	  cout << i << " " << j <<" "<< co<< endl;
	  next = j;
	  break;
	}
	if(j==n)i=n;
	}
    }
  

  cout <<co+n<< endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before '{' token
   18 |       if(j==max(next,i+1){
      |                          ^
      |                          ;
a.cc:21:9: error: expected primary-expression before 'else'
   21 |         else now = now^a[j];
      |         ^~~~
a.cc:20:10: error: expected ')' before 'else'
   20 |         }
      |          ^
      |          )
   21 |         else now = now^a[j];
      |         ~~~~
a.cc:18:9: note: to match this '('
   18 |       if(j==max(next,i+1){
      |         ^
Language: C++

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

long long a[200005];
long long s[200005]={0};
long long o[200005]={0};
long long nn[200005]={0}

int main(){
  int i,j,next=2;
  long long now=0,co=0,n;
  cin >> n;
  for(i=1;i<=n;i++){
    cin >> a[i];
    s[i]=s[i-1]+a[i];
    o[i]=o[i-1]-a[i];
    if(s[i]-s[i-nn[i-1]]==o[i])nn[i]=nn[i-1];
    else {
      o[i]=a[i];
      nn[i]=i;
    }
  }
  for(i=1;i<=n;i++){
    now=a[i];
    for(j=max(next,i+1);j<=n;j++){
      if(j==max(next,i+1){
	  for(int k=i+1;k<=j;k++)now =now^a[k];
	}
	else now = now^a[j];
	if(now==s[j]-s[i-1])co+=j-i;
	else {
	  cout << i << " " << j <<" "<< co<< endl;
	  next = j;
	  break;
	}
	if(j==n)i=n;
	}
    }
  

  cout <<co+n<< endl;

  return 0;
}


Compiler output:
a.cc:9:1: error: expected ',' or ';' before 'int'
    9 | int main(){
      | ^~~
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main()
{

	int N;
	cin >> N;

	vector<int> A(N, 0);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	} 

	int ans = N;

	for (int i = 0; i < N; i++) {
		int xor = A[i];
		int sum = A[i];
			
		for (int j = i + 1; j < N; j++) {
			xor ^= A[j];
			sum += A[j];
			if (xor == sum) {
				ans++;
			}
			else {
				break;
			} 
		}
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: expected unqualified-id before 'xor' token
   21 |                 int xor = A[i];
      |                     ^~~
a.cc:25:25: error: expected primary-expression before 'xor' token
   25 |                         xor ^= A[j];
      |                         ^~~
a.cc:25:29: error: expected primary-expression before '^=' token
   25 |                         xor ^= A[j];
      |                             ^~
a.cc:27:29: error: expected primary-expression before 'xor' token
   27 |                         if (xor == sum) {
      |                             ^~~
a.cc:27:33: error: expected primary-expression before '==' token
   27 |                         if (xor == sum) {
      |                                 ^~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<vector>
#include<cstdio>

using namespace std;




int main()
{
	int N, a, xor = 0, sum = 0, ans = 0;
	char c;
	vector<int> A;

	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a;
		A.push_back(a);
	}
	
	for (int l = 0; l < N; l++) {
		for (int r = l; r < N; r++) {
			for (int x = l; x < r+1; x++) {
				xor = xor^A[x];
				sum += A[x];
			}
			if(xor==sum)ans++;
			xor = 0;
			sum = 0;
		}
	}

	cout << ans;

	char qq;
	cin >> qq;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: expected unqualified-id before 'xor' token
   18 |         int N, a, xor = 0, sum = 0, ans = 0;
      |                   ^~~
a.cc:31:33: error: expected primary-expression before 'xor' token
   31 |                                 xor = xor^A[x];
      |                                 ^~~
a.cc:31:37: error: expected primary-expression before '=' token
   31 |                                 xor = xor^A[x];
      |                                     ^
a.cc:31:39: error: expected primary-expression before 'xor' token
   31 |                                 xor = xor^A[x];
      |                                       ^~~
a.cc:31:42: error: expected primary-expression before '^' token
   31 |                                 xor = xor^A[x];
      |                                          ^
a.cc:32:33: error: 'sum' was not declared in this scope
   32 |                                 sum += A[x];
      |                                 ^~~
a.cc:34:28: error: expected primary-expression before 'xor' token
   34 |                         if(xor==sum)ans++;
      |                            ^~~
a.cc:34:31: error: expected primary-expression before '==' token
   34 |                         if(xor==sum)ans++;
      |                               ^~
a.cc:34:33: error: 'sum' was not declared in this scope
   34 |                         if(xor==sum)ans++;
      |                                 ^~~
a.cc:34:37: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |                         if(xor==sum)ans++;
      |                                     ^~~
      |                                     abs
a.cc:35:25: error: expected primary-expression before 'xor' token
   35 |                         xor = 0;
      |                         ^~~
a.cc:35:29: error: expected primary-expression before '=' token
   35 |                         xor = 0;
      |                             ^
a.cc:36:25: error: 'sum' was not declared in this scope
   36 |                         sum = 0;
      |                         ^~~
a.cc:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |         cout << ans;
      |                 ^~~
      |                 abs
Language: C++

#include <stdio.h>

int xor(int* n,int from,int to){
  int ans=n[from];
  for(int i=from+1;i<=to;i++){
    ans ^= n[i];
  }
  return ans;
}

int sum(int* n,int from,int to){
  int ans=n[from];
  for(int i=from+1;i<=to;i++){
    ans +=n[i];
  }
  return ans;
}

int main(void){
  int size;
  scanf("%d",&size);
  int n[200010];
  for(int i=0;i<size;i++){
    scanf("%d",n+i);
  }
  
  int ctr=0;
  for(int l=0;l<size;l++){
    for(int r=l;r<size;r++){
      ctr+=(xor(n,l,r)==sum(n,l,r));
      //printf("\n%d %d %d %d \n",l,r,xor(n,l,r),sum(n,l,r));
    }
  }
  
  printf("%d",ctr);
  return 0;
}


Compiler output:
a.cc:3:5: error: expected unqualified-id before 'xor' token
    3 | int xor(int* n,int from,int to){
      |     ^~~
a.cc: In function 'int main()':
a.cc:30:13: error: expected primary-expression before 'xor' token
   30 |       ctr+=(xor(n,l,r)==sum(n,l,r));
      |             ^~~
Language: C++

#include<stdio.h>

int main(){
    int n,i,j,ans=0,Xor,sum;
    int a[200000];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }

    for(j=1;j<n;j++){
        Xor = sum = a[j-1];
        for(i=j;i<n;i++){
            Xor = Xor ^ a[i];
            sum = sum + a[i];
            
            ans+=(xor&&sum);
            
        }
    }
    ans+=n;
    printf("%d\n",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: expected primary-expression before 'xor' token
   17 |             ans+=(xor&&sum);
      |                   ^~~
a.cc:17:24: error: label 'sum' used but not defined
   17 |             ans+=(xor&&sum);
      |                        ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<stack>
#include<queue>
#include<vector>
using namespace std;
typedef unsigned long long int ulli;
const int INF = 2000000005;
vector<int> befbit;
vector<ulli> afbit;
ulli biter(int tar) {
	ulli ans = 0;
	for (int i = 0; tar > 0; i++) {
		ans += (tar % 2)*pow(10, i);
		tar /= 2;
	}
	return ans;
}
ulli xorplus(ulli a, ulli b) {
	ulli ans = 0;
	int i = 0;
	while (a>0||b>0) {
		int ka = a % 10;
		int kb = b % 10;
		ans += ((ka + kb) % 2)*pow(10, i);
		a /= 10;
		b /= 10;
		i++;
	}
	return ans;
}
bool tarcheck(ulli a, ulli b) {
	bool tf = true;
	ulli ans = 0;
	int i = 0;
	while (a>0 || b>0) {
		int ka = a % 10;
		int kb = b % 10;
		if (ka == kb&&ka==1) {
			tf = false;
			break;
		}
		ans += ((ka + kb) % 2)*pow(10, i);
		a /= 10;
		b /= 10;
		i++;
	}
	return tf;
}
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		befbit.push_back(a);
		afbit.push_back(biter(a));
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int nb = afbit[i];
		ans++;
		for (int j = i+1; j < n; j++) {
			if (tarcheck(nb, afbit[j])) {
				nb = xorplus(nb, afbit[j]);
				ans++;
			}
			else break;
		}
	}
	cout << ans << endl;
	//cout << xorplus(11000, 100001) << endl;
	//if (tarcheck(11000, 100001)) cout << "Ok" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'ulli biter(int)':
a.cc:15:34: error: 'pow' was not declared in this scope
   15 |                 ans += (tar % 2)*pow(10, i);
      |                                  ^~~
a.cc: In function 'ulli xorplus(ulli, ulli)':
a.cc:26:40: error: 'pow' was not declared in this scope
   26 |                 ans += ((ka + kb) % 2)*pow(10, i);
      |                                        ^~~
a.cc: In function 'bool tarcheck(ulli, ulli)':
a.cc:44:40: error: 'pow' was not declared in this scope
   44 |                 ans += ((ka + kb) % 2)*pow(10, i);
      |                                        ^~~
Language: C++

#include <iostream>
using namespace std;

int main(void){
	int n, l, r, i, ans, sum;
	unsigned int xor;
	int* a;

	cin >> n;
	a = new int [n];
	for(i = 0; i < n; i++)
		cin >> a[i];
	ans = 0;
	for(l = 0; l < n; l++) {
		for(r = l; r < n; r++) {
			sum = 0;
			xor = 0;
			for(i = l; i <= r; i++) {
				sum += a[i];
				xor ^= a[i];
			}
			if(sum == xor)
				ans++;
		}
	}

	cout << ans << endl;

	delete [] a;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:22: error: expected unqualified-id before 'xor' token
    6 |         unsigned int xor;
      |                      ^~~
a.cc:17:25: error: expected primary-expression before 'xor' token
   17 |                         xor = 0;
      |                         ^~~
a.cc:17:29: error: expected primary-expression before '=' token
   17 |                         xor = 0;
      |                             ^
a.cc:20:33: error: expected primary-expression before 'xor' token
   20 |                                 xor ^= a[i];
      |                                 ^~~
a.cc:20:37: error: expected primary-expression before '^=' token
   20 |                                 xor ^= a[i];
      |                                     ^~
a.cc:22:35: error: expected primary-expression before 'xor' token
   22 |                         if(sum == xor)
      |                                   ^~~
a.cc:22:38: error: expected primary-expression before ')' token
   22 |                         if(sum == xor)
      |                                      ^
Language: C++

#include <stdio.h>

int ok(int l, int r, long long a[])
{
    long long sum=0, xor=0;
    int i, j;
    for(i=l;i<r+1;i++)
    {
        sum+=a[i];
        xor=xor^a[i];
    }
    if(sum==xor)
        return 1;
    else
        return 0;

}

int main()
{
    long long  i, j, k, l, r, n, count;
    scanf("%lld", &n);
    long long a[200000];
    for(i=0;i<n;i++)
    {
        scanf("%lld", &a[i]);
    }
    count=0;
    for(i=0;i<n;i++)
    {
        for(j=i;j<n;j++)
        {
            if(ok(i,j,a)==1)
                count++;
        }
    }
    printf("%lld", count);



    return 0;
}


Compiler output:
a.cc: In function 'int ok(int, int, long long int*)':
a.cc:5:22: error: expected unqualified-id before 'xor' token
    5 |     long long sum=0, xor=0;
      |                      ^~~
a.cc:10:9: error: expected primary-expression before 'xor' token
   10 |         xor=xor^a[i];
      |         ^~~
a.cc:10:12: error: expected primary-expression before '=' token
   10 |         xor=xor^a[i];
      |            ^
a.cc:10:13: error: expected primary-expression before 'xor' token
   10 |         xor=xor^a[i];
      |             ^~~
a.cc:10:16: error: expected primary-expression before '^' token
   10 |         xor=xor^a[i];
      |                ^
a.cc:12:13: error: expected primary-expression before 'xor' token
   12 |     if(sum==xor)
      |             ^~~
a.cc:12:16: error: expected primary-expression before ')' token
   12 |     if(sum==xor)
      |                ^
a.cc:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String s = sc.next();
        String slist[] = s.split("");
        int count = 0;
        int min = N;
        for(int i = 0; i < N; i++){
            if(slist[i].equals("E")){
                count++;
            }
        }
        min = Math.min(min, count);
        for(int i = 1; i < N; i++){
            if(slist[i-1].equals("W"){
                count++;
            }
            if(slist[i].equals("E")){
                count--;
            }
            min = Math.min(min, count);
        }
        System.out.println(min);
    }
}


Compiler output:
Main.java:18: error: ')' expected
            if(slist[i-1].equals("W"){
                                     ^
1 error