Language: C++

#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
// #include<unordered_map>
#include<set>
// #include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
#include<functional>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
#define wl() cout << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll from, to, cost;
	bool operator<(const edge& right) const {
		return cost < right.cost;
	}
};
struct point {
	ll x, y, idx;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

template<typename T>
T minT(T a, T b) {
	if (a < b) return a;
	else return b;
}

template<typename T>
T maxT(T a, T b) {
	if (a > b) return a;
	else return b;
}

template<typename T>
T absT(T a) {
	if (a < 0) a *= -1;
	return a;
}

template<typename T>
T powT(T a, T x) {
	T res = 1;
	while (x > 0) {
		if (x & 1) res = res*a;
		a = a*a;
		x >>= 1;
	}
	return res;
}

ll StoLL(string str) {
	ll ret = 0, ini = 0;
	if (str[0] == '-') ini = 1;
	repi(i, ini, str.length()) {
		ret *= 10;
		ret += (ll)(str[i] - '0');
	}
	if (ini) ret *= -1;
	return ret;
}

///////////////////////////////////////////////////////////////////////////////////////

ll a[MAX_10p5 * 2], dp[MAX_10p5 * 2];
ll l, r, xor, sum, ans;

int main() {
	ll N;
	cin >> N;
	repi(i, 0, N) {
		cin >> a[i];
	}

	xor ^= a[r];
	sum += a[r];
	
	while (1) {
		if (r == N) {
			while (l < N - 1) {
				l++;
				dp[l] = dp[l - 1] - 1;
			}
			break;
		}
		if (xor == sum) {
			dp[l]++;
			r++;
			xor ^= a[r];
			sum += a[r];
		}
		else {
			xor ^= a[l];
			sum -= a[l];
			l++;
			if (l > r) {
				r++;
				xor ^= a[r];
				sum += a[r];
			}
			dp[l] = r - l;
		}
	}

	repi(i, 0, N) {
		ans += dp[i];
	}
	wrln(ans);

	return 0;
}


Compiler output:
a.cc:93:10: error: expected unqualified-id before 'xor' token
   93 | ll l, r, xor, sum, ans;
      |          ^~~
a.cc: In function 'int main()':
a.cc:102:9: error: expected primary-expression before 'xor' token
  102 |         xor ^= a[r];
      |         ^~~
a.cc:102:13: error: expected primary-expression before '^=' token
  102 |         xor ^= a[r];
      |             ^~
a.cc:103:9: error: 'sum' was not declared in this scope
  103 |         sum += a[r];
      |         ^~~
a.cc:113:21: error: expected primary-expression before 'xor' token
  113 |                 if (xor == sum) {
      |                     ^~~
a.cc:113:25: error: expected primary-expression before '==' token
  113 |                 if (xor == sum) {
      |                         ^~
a.cc:116:25: error: expected primary-expression before 'xor' token
  116 |                         xor ^= a[r];
      |                         ^~~
a.cc:116:29: error: expected primary-expression before '^=' token
  116 |                         xor ^= a[r];
      |                             ^~
a.cc:120:25: error: expected primary-expression before 'xor' token
  120 |                         xor ^= a[l];
      |                         ^~~
a.cc:120:29: error: expected primary-expression before '^=' token
  120 |                         xor ^= a[l];
      |                             ^~
a.cc:125:33: error: expected primary-expression before 'xor' token
  125 |                                 xor ^= a[r];
      |                                 ^~~
a.cc:125:37: error: expected primary-expression before '^=' token
  125 |                                 xor ^= a[r];
      |                                     ^~
a.cc:133:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
  133 |                 ans += dp[i];
      |                 ^~~
      |                 abs
a.cc:135:14: error: 'ans' was not declared in this scope; did you mean 'abs'?
  135 |         wrln(ans);
      |              ^~~
a.cc:24:25: note: in definition of macro 'wrln'
   24 | #define wrln(x) cout << x << endl
      |                         ^