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

#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite) for(auto ite=begin(que) ; ite!=end(que) ; ite++)
const int max_n = 1e5;
const ll mod = 1e9+7;
const ll INF = 1e17;
const int inf = 1e5;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return a ? gcd(b%a, a) : b; }
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
struct UnionFind {
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y); // merge technique
        par[x] += par[y];
        par[y] = x;
        return true;
    }

    int size(int x) {
        return -par[root(x)];
    }
};
struct SegmentTree{
  int N;
  vector<int> node;
  public :
    void intit(vector<int>v){
      int sz = v.size();
      N=1;
      while(N<sz) N*=2;
      node.resize(N);
      for(int i=0 ; i<sz ; i++) node[i+N-1] = v[i];
      for(int i=N-2 ; i>=0 ; i--) node[i] = min(node[i*2+1], node[i*2+2]);
    }
    void update(int x, int val){
      x += N-1;
      node[x+N-1] = val;
      while(x>0){
        x = (x-1)/2;
        node[x] = min(node[x*2+1], node[x*2+2]);
      }
    }
    int getmin(int a, int b, int k, int l, int r){
      if(b<=l || r<=a) return inf;
      else if(a<=l && r<=b) return node[k];
      else{
        int vl = getmin(a, b, 2*k+1, l, (l+r)/2);
        int vr = getmin(a, b, 2*k+2, (l+r)/2, r);
        return min(vl, vr);
      }
    }
};
int main(){
  int N;  cin>>N;
  vector<ll> v(N);
  rep(i,0,N) cin>>v[i];
  vector<int> d(50, 0);
  int ok = 1;
  rep(i,0,N) if(v[i] != 0) ok = 0;
  if(ok){
    cout << "Yes" << endl;
    return 0;
  }
  if(N%3 != 0){
    cout << "No" << endl;
    return 0;
  }
  map<ll, ll> ma;
  rep(i,0,N){
    ma[v[i]]++;
  }
  ll n = 0;
  for(auto j : ma){
    n++;
  }
  string ans = "No";
  int i = 0;
  vector<ll> m(n);
  for(auto j : ma){
    m[i++] = j.se;
  }
  sort(all(m));
  if(n == 2 && (2*m[0]==m[1])){
    ans = "Yes";
  }else if(n==3 && m[0]==m[1] && m[1]==m[2]){
    rep(i,0,N){
      for(int j=0 ; j<=20 ; j++){
        if(1<<j & v[i]) d[j]++;
      }
    }
    ok = 1;
    rep(i,0,21){
      if(d[j]%2 == 1) ok = 0;
    }
    if(ok) ans = "Yes";
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:122:12: error: 'j' was not declared in this scope
  122 |       if(d[j]%2 == 1) ok = 0;
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rep1(i, n) for(ll i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

ll main(){
  
  ll n;
  cin >> n;
  vector<ll> a(n);
  map<ll,ll> init;
  rep(i,n){
    cin >> a[i];
    init[a[i]] ++;
  }
  a.push_back(a.front());
  map<ll,ll> xini;
  rep(i,n){
    ll x = a[i]^a[i+1];
    xini[x] ++;
  }
  if(init == xini) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Compiler output:
a.cc:8:1: error: '::main' must return 'int'
    8 | ll main(){
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << endl; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin>>n;
  vl a(n);
  ll count = 0;
  bool z = true;
  rep(i, n){
    cin >> a[i];
    if(a[i]==0){
      count++;
    }
  }
  if(count==n){
    print("Yes");
    return 0;
  }
  else if (n % 3 != 0){
    print("No");
    return 0;
  }
  sort(all(a));
  ll c = a[0] ^ a[n / 3] ^ a[n - 1];
  if (count == n / 3 && a[n / 3] == a[n - 1]){
    print("Yes");
  }
  else if(a[0]==a[n/3-1]&&a[n/3]==a[n/3*2-1]&&a[n/3*2]==a[n-1]&&a[0]!=a[n/3]&&a[n/3]!=a[n/3*2]&&c==0){
    print("Yes");
  }
  else
    [print("No");
    ]
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:17: error: expected ',' before ';' token
   52 |     [print("No");
      |                 ^
      |                 ,
a.cc:52:17: error: expected identifier before ';' token
a.cc:52:17: error: expected ']' before ';' token
   52 |     [print("No");
      |                 ^
      |                 ]
a.cc: In lambda function:
a.cc:52:17: error: expected '{' before ';' token
a.cc: In function 'int main()':
a.cc:53:5: error: expected primary-expression before ']' token
   53 |     ]
      |     ^
Language: C++

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

#define MAX_A 1'000'000

using namespace std;

int A[MAX_N];

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  for (int i = 0; i < N; ++i) {
    bitset<MAX_A> B0(A[(i + N - 1) % N]);
    bitset<MAX_A> B1(A[i]);
    bitset<MAX_A> B2(A[(i + 1) % N]);
    bitset<MAX_A> B = B0 ^ B2;
    if (B1 != B) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
}

Compiler output:
a.cc:9:7: error: 'MAX_N' was not declared in this scope; did you mean 'MAX_A'?
    9 | int A[MAX_N];
      |       ^~~~~
      |       MAX_A
a.cc: In function 'int main()':
a.cc:15:12: error: 'A' was not declared in this scope
   15 |     cin >> A[i];
      |            ^
a.cc:18:22: error: 'A' was not declared in this scope
   18 |     bitset<MAX_A> B0(A[(i + N - 1) % N]);
      |                      ^
Language: C++

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

#define MAX_A 1'000'000'000

using namespace std;

int A[MAX_N];

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  for (int i = 0; i < N; ++i) {
    bitset<MAX_A> B0(A[(i + N - 1) % N]);
    bitset<MAX_A> B1(A[i]);
    bitset<MAX_A> B2(A[(i + 1) % N]);
    bitset<MAX_A> B = B0 ^ B2;
    if (B1 != B) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
}

Compiler output:
a.cc:9:7: error: 'MAX_N' was not declared in this scope; did you mean 'MAX_A'?
    9 | int A[MAX_N];
      |       ^~~~~
      |       MAX_A
a.cc: In function 'int main()':
a.cc:15:12: error: 'A' was not declared in this scope
   15 |     cin >> A[i];
      |            ^
a.cc:18:22: error: 'A' was not declared in this scope
   18 |     bitset<MAX_A> B0(A[(i + N - 1) % N]);
      |                      ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll i,ans=1;rep(i,0,n)ans*=x;return ans;}
/*階乗*/ll fact(ll x){ll i,ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)/fact(r)/fact(n-r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;ll i;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll i,fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=0,i=0;while(n/10>0){i++;d++;}return d;}
llfor;ll ans=0;////////////////////////////////////////////////////////////
int main(){
 ll n;
 sc(n);
 ll xo;
 ll a;
 sc(xo);
 rep(i,1,n){
  sc(a)
  xo^=a;
 }
 if(xo==0)py;
 else pn;

return 0;}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:3: error: expected ';' before 'xo'
   60 |   xo^=a;
      |   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using ld = long double;
const ll ATCODER_AMARI = 1000000007; //10^9 + 7
const ll INF = 10000000000000;

//階乗関数　ATCODER_AMARIに注意
ll factorial(ll k){
  ll sum = 1;
  for(int i = 1 ; i < k + 1; i++) {
    sum *= i;
    //sum = sum % ATCODER_AMARI;
  }
  return sum;
}

int main() {
  ll n;
  cin >> n;
  std::vector<ll> a(n);

  for(ll i; i < n; i++) cin >> a.at(i);

  sort(a.begin(), a.end());

  ll tmp = a.at(0);
  int flag = 0;

  for(ll i = 0; i < n; i++) {

    if(a.at(i) != tmp) flag++;
    tmp = a.at(i);
  }

  if(flag == 0) {
    if(a.at(0) == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
  }
  else if(n % 3 == 0) {
    
    if(flag == 1) {
      if(a.at(n / 3 - 1) == 0) cout << "Yes" << endl;
      else cout << "No" << endl;
      return 0;
    }
    else if(flag == 2) {
      if(a.at(n / 3 - 1) != a.at(n / 3) && a.at(2*n / 3 - 1) != a.at(2*n / 3)) {
        if(a.at(n / 3 - 1) ^ a.at(n / 3) ^ a.at(2*n / 3) == 0) cout << "Yes" << endl;
        else cout << "No" << endl;
        return 0;
      }
      else {
        cout << "No" << endl;
        return 0;
      }
    }
    else {
      cout << "No" << endl;
      return 0;
    }
  }
  else if(n % 3 != 0) {
    cout << "No" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:2: error: expected '}' at end of input
   68 | }
      |  ^
a.cc:19:12: note: to match this '{'
   19 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
#define pb push_back
#define pi pair<int, int>
#define l first
#define r second
#define all(x) x.begin(), x.end()
#define fori(a, b, step) for (int i = a; i < b; i += step)
#define forj(a, b, step) for (int j = a; j < b; j += step)

const int maxn = 5e5 + 1, mod = 1e9 + 7;

using namespace std;

int a[maxn];
int cnt[32];

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        for (int j = 0, x = a[i]; j < 32; j++, x /= 2)
            cnt[j] += x % 2;
    }
    vector<bool> reg(32, 0);
    int cnt = 0;
    for (int j = 31; j >= 0; j--) {
        if (cnt[j] && (n % 3 || cnt[j] != 2 * n / 3)) {
            cout << "No";
            return 0;
        }
        reg[j] = (cnt[j] > 0);
        cnt += reg[j];
    }
    if (cnt == 0) {
        cout << "Yes";
        return 0;
    }
    map<int, int> mp;
    for (int i = 0; i < n; i++)
        mp[a[i]]++;
    if (mp.size() > 3 || mp.size() == 1) {
        cout << "No";
        return 0;
    }
    vector<pi> cv;
    for (auto gg : mp)
        cv.pb(gg);
    if (cv.size() == 2) {
        if (cv[0].r != n / 3 &&
            cv[1].r != n / 3) {
            cout << "No";
            return 0;
        }
        int x = (cv[0].r == n / 3 ? cv[1].l : cv[0].l);
        int y = (cv[0].l == x ? cv[1].l : cv[0].l);
        int cx = x;
        while (cx) {
            if (cx % 2) {
                cout << "No";
                return 0;
            }
            cx /= 2;
        }
        if (y) {
            cout << "No";
            return 0;
        }
    } else {
        if (cv[0].r != n / 3 ||
            cv[1].r != n / 3) {
                cout << "No";
                return 0;
            }
        int x = cv[0].l, y = cv[1].l, z = cv[2].l;
        bool fg = 1;
        for (int i = 0; i < 32; i++, x /= 2, y /= 2, z /= 2) {
            if (!reg[i]) continue;
            if ((x % 2 == 0) + (y % 2 == 0) + (z % 2 == 0) != 1) {
                cout << "No";
                return 0;
            }
        }
    }
    cout << "Yes";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:16: error: invalid types 'int[int]' for array subscript
   30 |         if (cnt[j] && (n % 3 || cnt[j] != 2 * n / 3)) {
      |                ^
a.cc:30:36: error: invalid types 'int[int]' for array subscript
   30 |         if (cnt[j] && (n % 3 || cnt[j] != 2 * n / 3)) {
      |                                    ^
a.cc:34:22: error: invalid types 'int[int]' for array subscript
   34 |         reg[j] = (cnt[j] > 0);
      |                      ^
Language: C++

#include <bits/stdc++.h>  
using namespace std;
using ll = long long int;
using pii = pair<int, int>;
#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
ll l=1000000007;
string alphabet="abcdefghijklmnopqrstuvwxyz";

int main() {
  int n; cin>>n;
  set<int> s;
  vector<pii> v;
  rep(i,n){
    int a; cin>>a; 
    s.insert(a);
    if(v.size()<s.size()){pii p= make_pair(a,1);v.push_back(p);}
    else{
      rep(j,v.size()){
        if(v[j].first==a){v[j].second++;}
      }
    }
        
  }
  if(v.size()>3){cout<<"No";}
  else if(v.size()==1){
    if(v[0].first==0){cout<<"Yes";}
    else{cout<<"No";}
  }
  else if(v.size()==2){
    if(n%3==0 && v[0].second==v[1].second&&
       v[0].first*v[1].first==0){
      if(v[0].first==0 && v[0].second*2==v[1].second){cout<<"Yes";}
      else if(v[1].first==0 && v[1].second*2==v[0].second){cout<<"Yes";}
      else{cout<<"No";}
    }
    else{cout<<"No";}
  }
  else if(v.size()==3){
    bitset<17> x(v[0].first);
    bitset<17> y(v[1].first);
    bitset<17> z(v[2].first);
    if(v[0].second==v[1].second && v[1].second==v[2].second
      &&((x ^ y) ==z||(y ^ z)==x||(z ^ x) ==y )){cout<<"Yes";}
    else{cout<<"No";}
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:45:4: error: expected '}' at end of input
   45 |   }
      |    ^
a.cc:9:12: note: to match this '{'
    9 | int main() {
      |            ^
Language: C++

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

int main() {
  int N;
  cin >> N;
  cout << 1 xor 2 << endl; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:19: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
    8 |   cout << 1 xor 2 << endl;
      |                 ~~^~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    int n;
    cin >> n;
    if (n % 3 != 0) {
        bool ng = 0;
        for (i = 0; i < n; i++) {
            int a;
            cin >> a;
            if (a != 0) ng = 1;
        }
        if (ng)
            cout << "No" << endl;
        else
            cout << "Yes" << endl;
    } else {
        set<int> st;
        map<int, int> ma;
        for (i = 0; i < n; i++) {
            int a;
            cin >> a;
            ma[a]++;
            st.inser(a);
        }
        if (st.size() == 1) {
            if (ma[0] == n) cout << "Yes" << endl;
            return 0;
        }
        if (st.size() == 2) {
            if (ma[0] == n / 3) cout << "Yes" << endl;
            return 0;
        }
        if (st.size() == 3) {
            int x = 0;
            bool ok = 1;
            for (auto it = ma.begin(); it != ma.end(); ++it) {
                x ^= it->first;
                if (it->second != n / 3) ok = 0;
            }
            if (ok && x == 0) {
                cout << "Yes" << endl;
                return 0;
            }
        }
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:16: error: 'class std::set<int>' has no member named 'inser'; did you mean 'insert'?
   57 |             st.inser(a);
      |                ^~~~~
      |                insert
Language: C++

#include<iostream>
#include<algorithm>
#include<map>

using namespace std;

map<int, int> cnt;
int a[100005];

int main(){
    int N, temp = 0;
    cin >> N;
    for(int i=1; i<=N; i++){
        int num;    
        cin >> num;
        cnt[num]++;
        if(i == 1){
            temp++;
            a[temp] = num;
        } else if(cnt[num] == 1){
            temp++;
            a[temp] = num;
        }
    }
    sort(a+1, a+temp+1);
    if (temp > 3){
        cout << "No" << endl;
    } else if(cnt[a[1]] == N/3 && cnt[a[2]] == N/3 ){
        if((me == 0){
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else if(a[1] == 0 && cnt[a[2]] == 2*N/3 && temp == 2){
        cout << "Yes" << endl;
    } else if(a[1] == 0 && cnt[0] == N){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:13: error: 'me' was not declared in this scope
   29 |         if((me == 0){
      |             ^~
a.cc:29:21: error: expected ')' before '{' token
   29 |         if((me == 0){
      |           ~         ^
      |                     )
a.cc:34:5: error: expected primary-expression before '}' token
   34 |     } else if(a[1] == 0 && cnt[a[2]] == 2*N/3 && temp == 2){
      |     ^
Language: C++

#include<iostream>
#include<algorithm>
#include<map>

using namespace std;

map<int, int> cnt;
int a[100005];

int main(){
    int N, temp = 0;
    cin >> N;
    for(int i=1; i<=N; i++){
        int num;    
        cin >> num;
        cnt[num]++;
        if(i == 1){
            temp++;
            a[temp] = num;
        } else if(cnt[num] == 1){
            temp++;
            a[temp] = num;
        }
    }
    sort(a+1, a+temp+1);
    if (temp > 3){
        cout << "No" << endl;
    } else if(cnt[a[1]] == cnt[a[2]] == N/3 ){
        int me;
        me = a[1]^a[2]^a[3];
        if((me == 0){
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else if(a[1] == 0 && cnt[a[2]] == 2*N/3 && temp == 2){
        cout << "Yes" << endl;
    } else if(a[1] == 0 && cnt[0] == N){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:21: error: expected ')' before '{' token
   31 |         if((me == 0){
      |           ~         ^
      |                     )
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     } else if(a[1] == 0 && cnt[a[2]] == 2*N/3 && temp == 2){
      |     ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n);i++)
using namespace std;
using ll = long long;
using pii = pair<int,int>;

const int INF = 2e9;

int main(){
    int n;
    cin >> n;
    ll sum = 0;
    vector<int> a(n);
    rep(i,n){
        cin >> a[i];
        sum =^ a[i];
    }
    if(sum == 0){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:14: error: expected primary-expression before '^' token
   16 |         sum =^ a[i];
      |              ^
Language: C++

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

bool allZero(vector<int> num){
  for(int x : num){
    if(x != 0) return false;
  }
  return true;
}

int getOtherZero(vector<int> num){
  for(int x : num){
    if(x != 0) return x;
  }
  return -1;
}

bool typeOne(vector<int> num){
  int otherZero = getOtherZero(num);
  int cntZero = 0;
  int cntOther = 0;
  for(int x : num){
    if(x==0) cntZero++;
    else if(otherZero == x) cntOther++;
  }

  if(cntZero == num.size()/3 && cntOther == num.size()*2/3) return true;
  return false;
}

bool typeTwo(vector<int> num){

  vector<int> original = num;

  auto ip = unique(num.begin(), num.end());
  num.resize(distance(num.begin(), ip));
  if(num.size() != 3) return false;

  int a = num[0], b = num[1], c = num[2];
  if((a^b^c) != 0) return false;

  int cntA = 0, cntB = 0, cntC = 0;
  for(int x : original){
    if(x == a) cntA++;
    else if(x == b) cntB++;
    else if(x == c) cntC++;
  }

  return (cntA == original.size()/3 && cntB == original.size()/3 && cntC == original.size()/3);
}

string solve(vector<int> num){
  if(allZero(num)) return "Yes";
  if(num.size()%3 != 0) return "No";
  if(typeOne(num) || typeTwo(num)) return "Yes";
  return "No";
}

int main(){
  int n;
  cin >> n;

  vector<int> num(n);
  for(int i=0; i<n; i++) cin >> num[i];
  cout << solve(num) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'bool typeTwo(std::vector<int>)':
a.cc:36:13: error: 'unique' was not declared in this scope
   36 |   auto ip = unique(num.begin(), num.end());
      |             ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) int(x.size())

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const double PI=3.14159265358979323846;

int mod = 1e9+7;
int INF = 1e9+7;
// const long long INF = 1LL<<60;


int main(){
  int N;
  cin >> N;
  map<int, int> mp;
  rep(i, N){
    int a;
    cin >> a;
    mp[a]++;
  }

  vector<P> vect;
  for(P p: mp){
    vect.push_back(p);
  }
  sort(vect.begin(), vect.end();

  bool ok = false;

  // Length = 1
  if(sz(vect)==1) if(vect[0].first == 0) ok = true;
  // Length = 2
  if(sz(vect)==2){
    int cnt_0 = vect[0].second;
    int cnt_1 = vect[1].second;
    if(cnt_0==2*cnt_1 || 2*cnt_0==cnt_1){
      ok = true;
    }
  }
  // Length = 3
  if(sz(vect)==3){
    if(vect[0].second*3==N && vect[1].second*3==N && vect[2].second*3==N){
      int x = vect[0].first;
      int y = vect[1].first;
      int z = vect[2].first;
      if(x == (y^z) && y==(x^z) && z==(x^y)) ok = true;
    }
  }
  if(ok){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:32: error: expected ')' before ';' token
   33 |   sort(vect.begin(), vect.end();
      |       ~                        ^
      |                                )
Language: C++

#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;

int main(){
    int N; cin >> N;
    vector<int> A(N);
    multiset<int> s;
    REP(i,N){
      cin >> A[i]; s.insert(A[i]);
    }
    int tmp = -1;
    vector<int> t;
    for(auto itr : s){
      if(tmp != itr){
        t.push_back(itr);
      }
      tmp = itr;
    }
    int size = t.size();
    if(size == 1){
       if(s.count(0) != 0) cout << "Yes";
       else cout << "No";
    }
    if(size == 2){
       if(N%3 == 0 && s.count(0) == N/3 && s.count(t[1]) == 2*N/3) cout << "Yes";
       else cout << "No";
    }
    if(size == 3){
       if(N%3 == 0 && s.count(t[0]) == N/3 && s.count(t[1]) == N/3 && s.count(t[2]) == N/3){
         if(t[0]^t[1]^r[2] == 0) cout << "Yes";
         else cout << "No";
       }else cout << "No";
      
    }
    if(size >= 4) cout << "No";
    
 	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:23: error: 'r' was not declared in this scope
   43 |          if(t[0]^t[1]^r[2] == 0) cout << "Yes";
      |                       ^
Language: C++


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

#define REP(i, n) for (ll (i) = 0 ; (i) < (ll)(n) ; ++(i))
#define REPN(i, m, n) for (ll (i) = m ; (i) < (ll)(n) ; ++(i))
#define REP_REV(i, n) for (ll (i) = (ll)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (ll (i) = (ll)(n) - 1 ; (i) >= m ; --(i))

#define INF             2e9
#define INF_LL          1LL<<60
#define ll              long long
#define Ceil(x, n)      (((((x))+((n)-1))/n))
#define CeilN(x, n)     (((((x))+((n)-1))/n)*n)
#define FloorN(x, n)    ((x)-(x)%(n))
#define ALL(x)          (x).begin(),(x).end()
typedef pair<ll, ll>    P;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    set<int> st;
    REP(i, n) {
        cin >> a[i];
        st.insert(a[i]);
    }
    int kosu = 0;
    bool flag = true;
    REP(i, n) {
        if(a[i] != 0) {
            flag = false;
        } else {
            kosu++;
        }
    }
    if(flag) {
        cout << "Yes" << endl;
        return 0;
    }

    if(n % 3 != 0) {
        cout << "No" << endl;
        return 0; 
    }

    if((st.size() == 2) && (kosu == n/3)) {
        int tmp = 0;
        REP(i, n) {
            if(a[i] != 0) {
                tmp = a[i];
            } 
        }
        REP(i, n) {
            if(a[i] != 0) {
                if(tmp != a[i]) {
                    cout << "No" << endl;
                    return 0;
                }
            }
        }
        cout << "Yes" << endl;
        return 0;
    }

    if(st.size() == 3) {
        int idx = 0;
        vector<int> tmp(3);
        for(auto i: st) {
            tmp[idx] = i;
            //cout << i << endl;
            idx++;
        }
        int a = 0, b = 0, c = 0;
        REP(i, n) {
            if(a[i] == tmp[0]) a++;
            else if(a[i] == tmp[1]) b++;
            else c++;
        }
        if((a == n/3) && (b == n/3) && (c == n/3)) {
            if((tmp[0] ^ tmp[1] ^ tmp[2]) == 0) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }



    cout << "No" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:17: error: invalid types 'int[long long int]' for array subscript
   76 |             if(a[i] == tmp[0]) a++;
      |                 ^
a.cc:77:22: error: invalid types 'int[long long int]' for array subscript
   77 |             else if(a[i] == tmp[1]) b++;
      |                      ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(int argc, const char *argv[]) {
  int n;
  cin >> n;

  vector<int> va(n);
  map<int, int> cnts;
  for (int i = 0; i < n; i++) {
    cin >> va[i];
    cnts[va[i]]++;
  }

  if (cnts[0] == n) {
    cout << "Yes\n";
    return 0;
  }

  if (n % 3 != 0 || (cnts.size() != 2 && cnts.size() != 3)) {
    cout << "No\n";
    return 0;
  }

  bool ans;
  if (cnts.size() == 2) {
    auto p = *cnts.begin();
    ans = p.first == 0 && p.second == n / 3;
  } else {
    int xor_all = accumulate(cnts.begin(), cnts.end(), 0,
                             [&](auto a, auto b) { return a.first ^ b.first; });
    ans = xor_all == 0 && all_of(cnts.begin(), cnts.end(),
                                 [&](auto p) { return p.second == n / 3; });
  }

  cout << (ans ? "Yes" : "No") << '\n';
  return 0;
}


Compiler output:
a.cc: In instantiation of 'main(int, const char**)::<lambda(auto:28, auto:29)> [with auto:28 = int; auto:29 = std::pair<const int, int>]':
/usr/include/c++/14/bits/stl_numeric.h:169:22:   required from '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation) [with _InputIterator = _Rb_tree_iterator<pair<const int, int> >; _Tp = int; _BinaryOperation = main(int, const char**)::<lambda(auto:28, auto:29)>]'
  169 |         __init = __binary_op(_GLIBCXX_MOVE_IF_20(__init), *__first);
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:31:29:   required from here
   31 |     int xor_all = accumulate(cnts.begin(), cnts.end(), 0,
      |                   ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   32 |                              [&](auto a, auto b) { return a.first ^ b.first; });
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:32:61: error: request for member 'first' in 'a', which is of non-class type 'int'
   32 |                              [&](auto a, auto b) { return a.first ^ b.first; });
      |                                                           ~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int64_t>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  if(N%3!=0){
  bool x=true;
    for(int i=0;i<N;i++)
      if(A.at(i)!=0){x=false; break;}
    if(x)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  
  }else{
  sort(A.begin(),A.end());
    set<int64_t>S1; set<int64_t>S2; set<int64_t>S3;
  int k=N/3;
    for(int i=0;i<k;i++)
      S1.insert(A.at(i));
    for(int i=k;i<(2*k);i++)
      S2.insert(A.at(i));
    for(int i=(2*k);i<N;i++)
      S3.insert(A.at(i));
      int a=S1.size();
    int b=S2.size();
    int c=S3.size();
    if(a!=1 || b!=1 || c!=1)
      cout<<"No"<<endl;
    else{
    int64_t n=A.at(i); int64_t m=A.at(i); int64_t l=A.at(i);
      if((n^m^l)==0)
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    
    }
  
  
  
  
  }
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:20: error: 'i' was not declared in this scope
   34 |     int64_t n=A.at(i); int64_t m=A.at(i); int64_t l=A.at(i);
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  if(N%3!=0){
  bool x=true;
    for(int i=0;i<N;i++)
      if(A[i]!=0){x=false; break;}
    if(x)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  
  }else{
  sort(A.begin(),A.end());
    set<int>S1; set<int>S2; set<int>S3;
  int k=N/3;
    for(int i=0;i<k;i++)
      S1.insert(A[i]);
    for(int i=k;i<2*k;i++)
      S2.insert(A[i]);
    for(int i=2*k;i<N;i++)
      S3.insert(A[i]);
      int a=S1.size();
    int b=S2.size();
    int c=S3.size();
    if(a!=1 || b!=1 || c!=1)
      cout<<"No"<<endl;
    else{
    int n=A[0]; int m=A[k]; int l=A[2*k];
      if((n^m)^l==0)
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    
    }
  
  
  
  
  }
   return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  if(N%3!=0){
  bool x=true;
    for(int i=0;i<N;i++)
      if(A[i]!=0){x=false; break;}
    if(x)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  
  }else{
  sort(A.begin(),A.end());
    set<int>S1; set<int>S2; set<int>S3;
  int k=N/3;
    for(int i=0;i<k;i++)
      S1.insert(A[i]);
    for(int i=k;i<2*k;i++)
      S2.insert(A[i]);
    for(int i=2*k;i<N;i++)
      S3.insert(A[i]);
      int a=S1.size();
    int b=S2.size();
    int c=S3.size();
    if(a!=1 || b!=1 || c!=1)
      cout<<"No"<<endl;
    else{
    int n=A[0]; int m=A[k]; int l=A[2*k];
      if((n^m)^l==0 && n!=m && n!=l && m!=l)
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    
    }
  
  
  
  
  }
   return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++)
    cin>>A.at(i);
  if(N%3!=0){
  bool x=true;
    for(int i=0;i<N;i++)
      if(A[i]!=0){x=false; break;}
    if(x)
      cout<<"Yes"<<endl;
    else
      cout<<"No"<<endl;
  
  }else{
  sort(A.begin(),A.end());
    set<int>S1; set<int>S2; set<int>S3;
  int k=N/3;
    for(int i=0;i<k;i++)
      S1.insert(A[i]);
    for(int i=k;i<2*k;i++)
      S2.insert(A[i]);
    for(int i=2*k;i<N;i++)
      S3.insert(A[i])
      int a=S1.size();
    int b=S2.size();
    int c=S3.size();
    if(a!=1 || b!=1 || c!=1)
      cout<<"No"<<endl;
    else{
    int n=A[0]; int m=A[k]; int l=A[2*k];
      if((n^m)^l==0)
        cout<<"Yes"<<endl;
      else
        cout<<"No"<<endl;
    
    }
  
  
  
  
  }
   return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: expected ';' before 'int'
   27 |       S3.insert(A[i])
      |                      ^
      |                      ;
   28 |       int a=S1.size();
      |       ~~~             
a.cc:31:8: error: 'a' was not declared in this scope
   31 |     if(a!=1 || b!=1 || c!=1)
      |        ^
Language: C++

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



int main(){
    ll N;
    cin >> N;
    vector<ll> a(N ,0);
    ll cnt_E = 0,cnt_O = 0;
    for(int i = 0; i < N ; i++){
        cin >> a[i];
        ans ^= a[i];
    }
    if(ans == 0){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |         ans ^= a[i];
      |         ^~~
      |         abs
a.cc:16:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   16 |     if(ans == 0){
      |        ^~~
      |        abs
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <iomanip>
#include <unordered_map>
#include <stack>

using namespace std;
typedef long long  ll;

const ll mod = 1000000007;

int main()
{
	ll N;
	cin >> N;
	vector<ll> a(N);k
	for (ll i = 0; i < N; i++)
	{
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	if (N % 3 == 0)
	{
		if (a[0] == 0 && a[N / 3 - 1] == 0 && a[N / 3] == a[N - 1])
		{
			cout << "Yes" << endl;
			return 0;
		}
		else if (a[0] == a[N / 3 - 1] && a[N / 3] == a[2 * N / 3 - 1] && a[2 * N / 3] == a[N - 1] && (a[0]^a[N / 3]^a[2 * N / 3]) == 0 && a[0] != a[N / 3] && a[0] != a[2 * N / 3] && a[N / 3] != a[2 * N / 3])
		{
			cout << "Yes" << endl;
			return 0;
		}
		else
		{
			cout << "No" << endl;
			return 0;
		}
	}
	else
	{
		if (a[0] == 0 && a[N - 1] == 0)
		{
			cout << "Yes" << endl;
			return 0;
		}
		else
		{
			cout << "No" << endl;
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'k' was not declared in this scope
   20 |         vector<ll> a(N);k
      |                         ^
a.cc:21:24: error: 'i' was not declared in this scope
   21 |         for (ll i = 0; i < N; i++)
      |                        ^
Language: C++

from sys import stdin


def main():
    _ = int(input())
    a_lists = [int(x) for x in stdin.readline().rstrip().split()]
    z = 0

    for a in a_lists:
        z ^= a

    if z == 0:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()


Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from sys import stdin
      | ^~~~
Language: C++

#include <vector>
#include <iostream>
#include <map>

using namespace std;
int main(){
  int n; cin >> n;
  // if(n%3!=0){cout << "No" << endl; return 0;}
  map<long long int,int> cnt;
  for(int i=0;i<n;i++){
    long long int a;
    cnt[a]++;
  }
  if(cnt.size()>3 ||cnt.size()==1 ||cnt.size()==2)
  	{cout << "No" << endl; return 0;}
  else if(cnt.size()==0) {
    if(cnt[0].first==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
    }
  else{
    if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
    	if(cnt[0].first^cnt[1].first==cnt[2].first)
        {cout << "Yes" << endl;}
      else{cout << "No" << endl;}
    }
    else{
	    cout << "No" << endl;
    }
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: request for member 'first' in 'cnt.std::map<long long int, int>::operator[](0)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   17 |     if(cnt[0].first==0) cout << "Yes" << endl;
      |               ^~~~~
a.cc:22:15: error: request for member 'second' in 'cnt.std::map<long long int, int>::operator[](0)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   22 |     if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
      |               ^~~~~~
a.cc:22:30: error: request for member 'second' in 'cnt.std::map<long long int, int>::operator[](1)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   22 |     if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
      |                              ^~~~~~
a.cc:22:47: error: request for member 'second' in 'cnt.std::map<long long int, int>::operator[](1)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   22 |     if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
      |                                               ^~~~~~
a.cc:22:62: error: request for member 'second' in 'cnt.std::map<long long int, int>::operator[](2)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   22 |     if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
      |                                                              ^~~~~~
a.cc:23:19: error: request for member 'first' in 'cnt.std::map<long long int, int>::operator[](0)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   23 |         if(cnt[0].first^cnt[1].first==cnt[2].first)
      |                   ^~~~~
a.cc:23:32: error: request for member 'first' in 'cnt.std::map<long long int, int>::operator[](1)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   23 |         if(cnt[0].first^cnt[1].first==cnt[2].first)
      |                                ^~~~~
a.cc:23:46: error: request for member 'first' in 'cnt.std::map<long long int, int>::operator[](2)', which is of non-class type 'std::map<long long int, int>::mapped_type' {aka 'int'}
   23 |         if(cnt[0].first^cnt[1].first==cnt[2].first)
      |                                              ^~~~~
Language: C++

#include <vector>
#include <iostream>

using namespace std;
int main(){
  int n; cin >> n;
  // if(n%3!=0){cout << "No" << endl; return 0;}
  map<long long int,int> cnt;
  for(int i=0;i<n;i++){
    long long int a;
    cnt[a]++;
  }
  if(cnt.size()>3 ||cnt.size()==1 ||cnt.size()==2)
  	{cout << "No" << endl; return 0;}
  else if(cnt.size()==0) {
    if(cnt[0].first==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
    }
  else{
    if(cnt[0].second==cnt[1].second && cnt[1].second==cnt[2].second){
    	if(cnt[0].first^cnt[1].first==cnt[2].first)
        {cout << "Yes" << endl;}
      else{cout << "No" << endl;}
    }
    else{
	    cout << "No" << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'map' was not declared in this scope
    8 |   map<long long int,int> cnt;
      |   ^~~
a.cc:3:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
    2 | #include <iostream>
  +++ |+#include <map>
    3 | 
a.cc:8:7: error: expected primary-expression before 'long'
    8 |   map<long long int,int> cnt;
      |       ^~~~
a.cc:11:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |     cnt[a]++;
      |     ^~~
      |     int
a.cc:13:6: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |   if(cnt.size()>3 ||cnt.size()==1 ||cnt.size()==2)
      |      ^~~
      |      int
Language: C++

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

int main() {
    long N;
    cin >> N;
    bool ans = true;
    if (N % 3 != 0) {
        for (int i = 0; i < N; i++) {
            long a;
            cin >> a;
            if (a != 0) {
                ans = false;
            }
        }
    }
    else {
        bool b = false;
        map<long, long> data;
        priority_queue<long> keep;
        for (int i = 0; i < N; i++) {
            long a;
            cin >> a;
            if (!data.count(a)) {
                data[a] = 1;
                keep.push(a);
            }
            else {
                data[a] = data.at(a) + 1;
            }
        }
        if (data.size() >= 4) {
            ans = false;
            b = true;
        }
        else if (data.size() == 1) {
            if (keep.top() != 0) {
                ans = false;
            }
        }
        else if (data.size() == 2) {
            if (data.at(keep.top()) != N * 2 / 3) {
                ans = false;
            }
            keep.pop();
            if (keep.top() != 0) {
                ans = false;
            }
            if (data.at(keep.top()) != N / 3) {
                ans = false;
            }
        }
        else if (data.size() == 3) {
            long x, y, z;
            x = keep.top();
            keep.pop();
            y = keep.top();
            keep.pop();
            z = keep.top();
            keep.pop();
            if (data.at(x) != N / 3 || data.at(y) != N / 3 || data.at(z) != N / 3) {
                ans = false;
            }
            if (x ^ y ^ z != 0) {
                ans = false;
            }
        }
    }

    /*if (ans) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }*/
    if (b) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:9: error: 'b' was not declared in this scope
   76 |     if (b) {
      |         ^
Language: C++

#include<bits\stdc++.h>
using namespace std;
 int main()
 {
     long long int N,K,X=0;
     int i;
     cin>>N;
     for(i=1;i<=N;i++)
     {
         cin>>K;
         X ^= K;
     }
     if(X==0)
      cout<<"Yes";
      else
      cout<<"No";
 }


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

#include<iostream> 
#include<math.h>
using namespace std;
 int main()
 {
     long long int N,K,X=0;
     int i;
     cin>>N;
     for(i=1;4
     1 i<=N;i++)
     {
         cin>>K;
         X ^= K;
     }
     if(X==0)
      cout<<"Yes";
      else
      cout<<"No";
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: expected ';' before numeric constant
    9 |      for(i=1;4
      |               ^
      |               ;
   10 |      1 i<=N;i++)
      |      ~         
a.cc:10:7: error: expected ')' before 'i'
   10 |      1 i<=N;i++)
      |       ^~
      |       )
a.cc:9:9: note: to match this '('
    9 |      for(i=1;4
      |         ^
a.cc:10:16: error: expected ';' before ')' token
   10 |      1 i<=N;i++)
      |                ^
      |                ;
Language: C++

#include<bits\stdc++.h>
using namespace std;
 int main()
 {
     long long int N,K,X=0;
     int i;
     cin>>N;
     for(i=1;4
     1 i<=N;i++)
     {
         cin>>K;
         X ^= K;
     }
     if(X==0)
      cout<<"Yes";
      else
      cout<<"No";
 }


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

 #include<stdio.h>

int main()
{
    long long int n,m,s=0;

    scanf("%lld",&n);
    for(int i=0;i<n;i++){
        scanf("%lld",&m);
        s=s^m;
    }
    if(s!==0)
        printf("Yes\n");
    else
        printf("No\n");
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:12:11: error: expected expression before '=' token
   12 |     if(s!==0)
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(ll i=0;i<n;++i)

int main(void){
    int N;
    cin >> N;
    ll buf, res = 0;
    // x_i = x_{i+3}が常に成立
    REP(i,N){
        cin >> buf;
        res ^= buf
    }
    if(res==0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: expected ';' before '}' token
   13 |         res ^= buf
      |                   ^
      |                   ;
   14 |     }
      |     ~
Language: C++

include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    vector<vector<ll>> bits(n, vector<ll>(33, 0));
    for (int i = 0; i < 32; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (a[j] & (1LL << i))
                bits[j][i] = 1;
        }
    }
    bool k = true;
    ll f = 1;
    ll sum = 0;
    for (int i = 0; i < 32; i++)
    {
        if (bits[1][i] != bits[n - 1][i])
        {
            sum += f;
        }
        f << 1;
    }
    if (sum != a[0])
        k = false;

    for (int i = 1; i < n - 1; i++)
    {
        sum = 0;
        f = 1;
        for (int j = 0; j < 32; j++)
        {
            if (bits[i - 1][j] != bits[i + 1][j])
            {
                sum += f;
            }
            f << 1;
        }
        if (sum != a[i])
            k = false;
    }
    sum = 0;
    f = 1;
    for (int i = 0; i < 32; i++)
    {
        if (bits[n - 2][i] != bits[0][i])
            sum += f;
        f << 1;
    }
    if (sum != a[n - 1])
        k = false;
    cout << (k ? "Yes" : "No") << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n;
      |     ^~~
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<ll> a(n);
      |     ^~~~~~
a.cc:8:14: error: expected primary-expression before '>' token
    8 |     vector<ll> a(n);
      |              ^
a.cc:8:16: error: 'a' was not declared in this scope
    8 |     vector<ll> a(n);
      |                ^
a.cc:13:21: error: expected primary-expression before '>>' token
   13 |     vector<vector<ll>> bits(n, vector<ll>(33, 0));
      |                     ^~
a.cc:13:41: error: expected primary-expression before '>' token
   13 |     vector<vector<ll>> bits(n, vector<ll>(33, 0));
      |                                         ^
a.cc:13:24: error: 'bits' was not declared in this scope
   13 |     vector<vector<ll>> bits(n, vector<ll>(33, 0));
      |                        ^~~~
a.cc:61:5: error: 'cout' was not declared in this scope
   61 |     cout << (k ? "Yes" : "No") << endl;
      |     ^~~~
a.cc:61:35: error: 'endl' was not declared in this scope
   61 |     cout << (k ? "Yes" : "No") << endl;
      |                                   ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;cin >> N;vector<int> a(N);
    for(int i =0;i< n;i++) cin >> a[i];
    int S = a[0];
    for(int i = 1;i <N;i++) S ^=a[i];
    if (S == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:21: error: 'n' was not declared in this scope
    5 |     for(int i =0;i< n;i++) cin >> a[i];
      |                     ^