Language: C++

#include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>

#define rep(i, b) for(int i = 0; i < b; i++)
#define repi(i, a, b) for(int i = a; i < b; i++)
#define all(c) c.begin(),c.end()
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define MAX_V 1001
#define MAX_E 401
#define INF INT_MAX
#define MOD 1000000007
#define EPS 1e-7

typedef long long ll;
inline int toInt(std::string s) { int v; std::istringstream sin(s); sin >> v; return v; }
template<class T> inline std::string toString(T x) { std::ostringstream sout; sout << x; return sout.str(); }
using namespace std;

typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
#define X real()
#define Y imag()
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template< typename T >
struct edge {
	int src, to;
	T cost;

	edge(int to, T cost) : src(-1), to(to), cost(cost) {}

	edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}

	edge &operator=(const int &x) {
		to = x;
		return *this;
	}

	operator int() const { return to; }
};
template< typename T >
using Edges = vector< edge< T > >;
template< typename T >
using WeightedGraph = vector< Edges< T > >;
using UnWeightedGraph = vector< vector< int > >;
template< typename T >
using Matrix = vector< vector< T > >;

template <typename T>
inline std::string to_bin_str(T n) {
	std::string str;
	while (n > 0) {
		str.push_back('0' + (n & 1));
		n >>= 1;
	}
	std::reverse(str.begin(), str.end());

	while (str.size() != 20)
	{
		str = "0" + str;
	}
	return str;
}

ll to_num(ll num[20]) {
	ll ans = 0;
	ll two = 1;
	for (int j = 19; j > -1; j--)
	{
		ans += two * num[j];
		two *= 2;
	}
	return ans;
}

int main()
{
	ll n;
	cin >> n;
	vector<ll> a(n);
	vector<string> sxor(n);
	vector< vector<ll> > xor;
	xor.resize(n);		
	for (int i = 0; i<n; i++) {
		xor[i].resize(20);
	}
	vector<ll> sum(n);

	rep(i, n)
	{
		cin >> a[i];
	}
	rep(i, n)
	{
		if (i == 0)
		{
			sum[i] = a[0];
		}
		else {
			sum[i] = sum[i - 1] + a[i];
		}
		//cout << sum[i] << " ";
	}


	rep(i, n)
	{
		sxor[i] = to_bin_str(a[i]);
		//cout << sxor[i] << endl;
	}
	rep(i, n)
	{
		if (i == 0)
		{
			for(int j = 19; j > -1; j--)
			{
				if (sxor[i][j] == '0')
				{
					xor[i][j] = 0;
				}
				if (sxor[i][j] == '1')
				{
					xor[i][j] = 1;
				}
			}
			continue;
		}
		for (int j = 19; j > -1; j--)
		{
			if (sxor[i][j] == '1')
			{
				if (xor[i - 1][j] == 1)
				{
					xor[i][j] = 0;
				}
				else {
					xor[i][j] = 1;
				}
			}
			else {
				xor[i][j] = xor[i - 1][j];
			}
		}
	}

	ll res = 0;
	ll xxx;
	rep(i, n)
	{
		repi(j, i , n)
		{
			ll stmp;
			ll xt[20];
			ll xtmp;
			if (i == j)
			{
				res++;
				continue;
			}
			else {
				xxx = a[i];
				repi(k, i + 1, j + 1)
				{
					xxx = xxx ^ a[k];
				}
				if (i == 0)
				{
					stmp = sum[j];
				}
				else {
					stmp = sum[j] - sum[i - 1];
				}
				if (i == 0)
				{
					for (int k = 19; k > -1; k--)
					{
						if (xor[j][k] == 0)
						{
							xt[k] = 0;
						}
						else {
							xt[k] = 1;
						}
					}
				}
				else {
					for (int k = 19; k > -1; k--)
					{
						if (xor[j][k] == xor[i - 1][k])
						{
							xt[k] = 0;
						}
						else {
							xt[k] = 1;
						}
					}
				}
				xtmp = to_num(xt);
			}
			/*if (xtmp != xxx)
			{
				cout << "aaa" << endl;
			}
			cout << i << " " << j << " " << stmp << " " << xtmp << " " << xxx << endl;*/
			if (stmp == xtmp)
			{
				res++;
			}
		}
	}
	cout << res << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:104:30: error: expected unqualified-id before 'xor' token
  104 |         vector< vector<ll> > xor;
      |                              ^~~
a.cc:105:9: error: expected primary-expression before 'xor' token
  105 |         xor.resize(n);
      |         ^~~
a.cc:105:12: error: expected primary-expression before '.' token
  105 |         xor.resize(n);
      |            ^
a.cc:107:17: error: expected primary-expression before 'xor' token
  107 |                 xor[i].resize(20);
      |                 ^~~
a.cc: In lambda function:
a.cc:107:23: error: expected '{' before '.' token
  107 |                 xor[i].resize(20);
      |                       ^
a.cc: In function 'int main()':
a.cc:107:24: error: 'struct main()::<lambda()>' has no member named 'resize'
  107 |                 xor[i].resize(20);
      |                        ^~~~~~
a.cc:141:41: error: expected primary-expression before 'xor' token
  141 |                                         xor[i][j] = 0;
      |                                         ^~~
a.cc: In lambda function:
a.cc:141:47: error: expected '{' before '[' token
  141 |                                         xor[i][j] = 0;
      |                                               ^
a.cc: In function 'int main()':
a.cc:141:47: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:145:41: error: expected primary-expression before 'xor' token
  145 |                                         xor[i][j] = 1;
      |                                         ^~~
a.cc: In lambda function:
a.cc:145:47: error: expected '{' before '[' token
  145 |                                         xor[i][j] = 1;
      |                                               ^
a.cc: In function 'int main()':
a.cc:145:47: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:154:37: error: expected primary-expression before 'xor' token
  154 |                                 if (xor[i - 1][j] == 1)
      |                                     ^~~
a.cc:154:42: error: expected ',' before '-' token
  154 |                                 if (xor[i - 1][j] == 1)
      |                                          ^~
      |                                          ,
a.cc:154:43: error: expected identifier before '-' token
  154 |                                 if (xor[i - 1][j] == 1)
      |                                           ^
a.cc: In lambda function:
a.cc:154:47: error: expected '{' before '[' token
  154 |                                 if (xor[i - 1][j] == 1)
      |                                               ^
a.cc: In function 'int main()':
a.cc:154:47: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:156:41: error: expected primary-expression before 'xor' token
  156 |                                         xor[i][j] = 0;
      |                                         ^~~
a.cc: In lambda function:
a.cc:156:47: error: expected '{' before '[' token
  156 |                                         xor[i][j] = 0;
      |                                               ^
a.cc: In function 'int main()':
a.cc:156:47: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:159:41: error: expected primary-expression before 'xor' token
  159 |                                         xor[i][j] = 1;
      |                                         ^~~
a.cc: In lambda function:
a.cc:159:47: error: expected '{' before '[' token
  159 |                                         xor[i][j] = 1;
      |                                               ^
a.cc: In function 'int main()':
a.cc:159:47: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:163:33: error: expected primary-expression before 'xor' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                 ^~~
a.cc: In lambda function:
a.cc:163:39: error: expected '{' before '[' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                       ^
a.cc: In function 'int main()':
a.cc:163:39: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:163:45: error: expected primary-expression before 'xor' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                             ^~~
a.cc:163:50: error: expected ',' before '-' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                                  ^~
      |                                                  ,
a.cc:163:51: error: expected identifier before '-' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                                   ^
a.cc: In lambda function:
a.cc:163:55: error: expected '{' before '[' token
  163 |                                 xor[i][j] = xor[i - 1][j];
      |                                                       ^
a.cc: In function 'int main()':
a.cc:163:55: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:199:53: error: expected primary-expression before 'xor' token
  199 |                                                 if (xor[j][k] == 0)
      |                                                     ^~~
a.cc: In lambda function:
a.cc:199:59: error: expected '{' before '[' token
  199 |                                                 if (xor[j][k] == 0)
      |                                                           ^
a.cc: In function 'int main()':
a.cc:199:59: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:211:53: error: expected primary-expression before 'xor' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                     ^~~
a.cc: In lambda function:
a.cc:211:59: error: expected '{' before '[' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                           ^
a.cc: In function 'int main()':
a.cc:211:59: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
a.cc:211:66: error: expected primary-expression before 'xor' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                                  ^~~
a.cc:211:71: error: expected ',' before '-' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                                       ^~
      |                                                                       ,
a.cc:211:72: error: expected identifier before '-' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                                        ^
a.cc: In lambda function:
a.cc:211:76: error: expected '{' before '[' token
  211 |                                                 if (xor[j][k] == xor[i - 1][k])
      |                                                                            ^
a.cc: In function 'int main()':
a.cc:211:76: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')