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

#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;cin>>N;
    std::vector<int> a(N);
    std::set<int> s;
    for(int i=0;i<N;i++){
        cin>>a.at(i);
        s.insert(a.at(i));
    }
    
    if(*rbegin(s)==0&&s.size()==1){
        cout<<"Yes"<<endl;
        return 0;
    }
    else if(s.size() != 3){
        cout<<"No"<<endl;
        return 0;
    }
    else{
        vector<int> c(3),d(3, 0);
        c.at(0) = *begin(s);
        c.at(1) = *rbegin(s);
        s.erase(c.at(0));
        c.at(2) = *begin(s);
        for(int i=0;i<N;i++){
            for(int j=0;j<3;j++){
                if(c.at(j)==a.at(i)) d.at(j)++;
            }
        }
        if((d.at(0)==d.at(1))&&(d.at(0)==d.at(2)){
            cout <<"Yes"<<endl;
        }
        else cout <<"No "<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:50: error: expected ';' before '{' token
   31 |         if((d.at(0)==d.at(1))&&(d.at(0)==d.at(2)){
      |                                                  ^
      |                                                  ;
a.cc:34:9: error: expected primary-expression before 'else'
   34 |         else cout <<"No "<<endl;
      |         ^~~~
a.cc:33:10: error: expected ')' before 'else'
   33 |         }
      |          ^
      |          )
   34 |         else cout <<"No "<<endl;
      |         ~~~~
a.cc:31:11: note: to match this '('
   31 |         if((d.at(0)==d.at(1))&&(d.at(0)==d.at(2)){
      |           ^
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n; cin >> n;
  map<long long, int> mp;
  REP(i, n) {
    int a; cin >> a;
    ++mp[a];
  }
  if (n % 3 != 0) {
    cout << (mp.size() == 1 && mp.count(0) ? "Yes\n" : "No\n";
    return 0;
  }
  if (mp.size() == 2) {
    cout << (mp.count(0) && mp[0] == n / 3 && (*mp.rbegin()).second == 2 * n / 3 ? "Yes\n" : "No\n");
    return 0;
  }
  if (mp.size() == 3) {
    bool ok = true;
    for (auto p : mp) {
      if (p.second != n / 3) ok = false;
    }
    cout << (ok ? "Yes\n" : "No\n");
    return 0;
  }
  cout << "No\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:62: error: expected ')' before ';' token
   47 |     cout << (mp.size() == 1 && mp.count(0) ? "Yes\n" : "No\n";
      |             ~                                                ^
      |                                                              )
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin>>N;
  map<int,int> mp;
  REP(i,N){
    int tmp;
    cin>>tmp;
    mp[tmp]++;
  }
  bool ans=false;
  if(mp[0]==N)ans=true;
  if(N%3!=0){
    if(mp.size==2){
      if(mp[0]==N)ans=true;
    }
    if(mp.size==3){
      if(
        (mp.begin()->first ^ mp.begin()++->first ^ (mp.begin()++)++->first) == 0 &&
        mp.begin()->second == N/3 && mp.begin()++->second == N/3
      )ans=true;
    }
  }
  if(ans) cout<<"Yes"<<endl; else cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:11: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   41 |     if(mp.size==2){
      |        ~~~^~~~
      |               ()
a.cc:44:11: error: invalid use of member function 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::size() const [with _Key = int; _Tp = int; _Compare = std::less<int>; _Alloc = std::allocator<std::pair<const int, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   44 |     if(mp.size==3){
      |        ~~~^~~~
      |               ()
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9')x=x*10+(c-'0'),c=getchar();
    return x*f;
}
#define mod 1000000007
void MOD(int &x){if(x>=mod)x-=mod;}
#define maxn 100010
#define inf (1<<30)
int b[maxn],a[maxn];
int main(){
	int n;
	in(n);
	FOR(i,1,n){
		in(a[i]);
	}
	sort(a+1,a+n+1);
	int cnt=0;
	FOR(i,1,n)
		if(a[i]!=a[i-1]){
			b[++cnt]=a[i];
		}
	if(cnt>3)puts("No");
	else {
		if(n%3==0){
			if(cnt>3)puts("No");
			if((b[1]^b[2])==b[3]||(b[2]^b[3])==b[1]||(b[3]^b[1])==b[2]))puts("Yes");
			else puts("No");
		}
		else if(cnt<=1&&(b[1]^b[1])==0)puts("Yes");
		else puts("No");
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:84: error: expected primary-expression before ')' token
   41 |                         if((b[1]^b[2])==b[3]||(b[2]^b[3])==b[1]||(b[3]^b[1])==b[2]))puts("Yes");
      |                                                                                    ^
Language: C++

#include <iostream>
#include <algorithm>
#include <Vector>
using namespace std;

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

    sort(a, a + n);

    int idx = 1;
    vector<pair<int, int > > v;
    for (int i = 0; i < n - 1; i++) {
        if (a[i] == a[i + 1]) idx++;
        else {
            v.emplace_back(a[i], idx);
            idx = 1;
        }
    }
    v.emplace_back(a[n - 1], idx);

    bool ok = false;
    if (n % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }
    if (v.size() == 1) {
        if (v[0].first == 0) ok = true;
    }
    else if (v.size() == 2) {
        if (v[0].second == n/3 && v[1].second == 2 * n / 3) {
            if ((v[1].first ^ v[1].first) == v[0].first) ok = true;
        }
        if (v[0].second == 2*n/3 && v[1].second == n / 3) {
            if ((v[0].first ^ v[0].first) == v[1].first) ok = true;
        }
    }
    else if (v.size() == 3) {
        if (v[0].second == v[1].second && v[1].second == v[2].second) {
            if ((v[0].first ^ v[2].first) == v[1].first) ok = true;
        }
    }

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;

}


Compiler output:
a.cc:3:10: fatal error: Vector: No such file or directory
    3 | #include <Vector>
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
using namespace std;

#define INF 1e18
#define int long long

signed main() {
    int n; cin >> n;
    map<int, int> mp;
    for(int i = 0; i < n; i++) {
        int a; cin >> a;
        mp[a]++;
    }

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

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

    vector<int> cnt;
    for(auto& itr : mp) {
        for(int i = 0; i < itr.second / (n / 3); i++) {
            cnt.push_back(itr.first);
        }
    }

    if(cnt.size() == 3 && (cnt[0] ^ cnt[1] ^ cnt[2] == 0) {
        cout << "Yes" << endl;
        return 0;
    } else {
        cout << "No" << endl;
        return 0;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:58: error: expected ')' before '{' token
   44 |     if(cnt.size() == 3 && (cnt[0] ^ cnt[1] ^ cnt[2] == 0) {
      |       ~                                                  ^~
      |                                                          )
a.cc:51:1: error: expected primary-expression before '}' token
   51 | }
      | ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(3*n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  
  sort(a.begin(), a.begin() + n);
  for (int j = 0; j < (n+2)/3; ++j) a[n] ^= a[i] ^ a[i + n/3] ^ a[i + n/3*2];
  cout << (a[n] ? "No" : "Yes");
  return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: 'i' was not declared in this scope
   11 |   for (int j = 0; j < (n+2)/3; ++j) a[n] ^= a[i] ^ a[i + n/3] ^ a[i + n/3*2];
      |                                               ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(3*n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  
  sort(a.begin(), a.begin() + N);
  for (int j = 0; j < (n+2)/3; ++j) a[n] ^= a[i] ^ a[i + n/3] ^ a[i + n/3*2];
  cout << (a[n] ? "No" : "Yes");
  return 0;
}
	

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: 'N' was not declared in this scope
   10 |   sort(a.begin(), a.begin() + N);
      |                               ^
a.cc:11:47: error: 'i' was not declared in this scope
   11 |   for (int j = 0; j < (n+2)/3; ++j) a[n] ^= a[i] ^ a[i + n/3] ^ a[i + n/3*2];
      |                                               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main() {
int N, i, xor = 0;
cin >> N;
vector<int> a(3*N);
for(i = 0;i < N;++ i) cin >> a[i];
sort(a.begin(), a.begin()+N);
for(i = 0;i <= N/3;++ i) xor ^= a[i] ^ a[i + N/3] ^ a[i + N/3*2];
cout << (xor ? "No" : "Yes");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:11: error: expected unqualified-id before 'xor' token
    4 | int N, i, xor = 0;
      |           ^~~
a.cc:9:26: error: expected primary-expression before 'xor' token
    9 | for(i = 0;i <= N/3;++ i) xor ^= a[i] ^ a[i + N/3] ^ a[i + N/3*2];
      |                          ^~~
a.cc:9:30: error: expected primary-expression before '^=' token
    9 | for(i = 0;i <= N/3;++ i) xor ^= a[i] ^ a[i + N/3] ^ a[i + N/3*2];
      |                              ^~
a.cc:10:10: error: expected primary-expression before 'xor' token
   10 | cout << (xor ? "No" : "Yes");
      |          ^~~
a.cc:10:14: error: expected primary-expression before '?' token
   10 | cout << (xor ? "No" : "Yes");
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int N; cin >> N;
  if (N%3 != 0) {
    cout << "No" << endl;
    return;
  }
  
  map<int, int> m;
  for (int i=0; i<N; i++) 
  {
    int a;cin >> a;
    m[a]++;
  }

  string ans;
  if (m.size() == 1) {
    ans = (m[0] == N) ? "Yes" : "No";
  } else if (m.size() == 2) 
  {
    bool isOk = true;
    for(var p : m)
    {
      if (p.first == 0) {
        if (p.second != N/3) isOk = false;
      } else {
        if (p.second != 2*N/3) isOk = false;
      }
    }
    ans = (isOk) ? "Yes" : "No";
  } else if (m.size() == 3) {
    bool isOk = true;
    int tmp = 0;
    for (var p : m) {
      if (p.second != N/3) isOk=false;
      tmp ^= p.first;
    }
    if (tmp != 0) isOk=false
    ans = (isOk) ? "Yes" : "No";
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   10 |     return;
      |     ^~~~~~
a.cc:26:9: error: 'var' was not declared in this scope
   26 |     for(var p : m)
      |         ^~~
a.cc:34:9: error: could not convert 'ans.std::__cxx11::basic_string<char>::operator=((isOk ? ((const char*)"Yes") : ((const char*)"No")))' from 'std::__cxx11::basic_string<char>' to 'bool'
   34 |     ans = (isOk) ? "Yes" : "No";
      |     ~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |         |
      |         std::__cxx11::basic_string<char>
a.cc:35:3: error: expected primary-expression before '}' token
   35 |   } else if (m.size() == 3) {
      |   ^
a.cc:34:33: error: expected ')' before '}' token
   34 |     ans = (isOk) ? "Yes" : "No";
      |                                 ^
      |                                 )
   35 |   } else if (m.size() == 3) {
      |   ~                              
a.cc:26:8: note: to match this '('
   26 |     for(var p : m)
      |        ^
a.cc:35:3: error: expected primary-expression before '}' token
   35 |   } else if (m.size() == 3) {
      |   ^
a.cc:38:10: error: 'var' was not declared in this scope
   38 |     for (var p : m) {
      |          ^~~
a.cc:42:5: error: expected primary-expression before 'if'
   42 |     if (tmp != 0) isOk=false
      |     ^~
a.cc:41:6: error: expected ';' before 'if'
   41 |     }
      |      ^
      |      ;
   42 |     if (tmp != 0) isOk=false
      |     ~~
a.cc:42:5: error: expected primary-expression before 'if'
   42 |     if (tmp != 0) isOk=false
      |     ^~
a.cc:41:6: error: expected ')' before 'if'
   41 |     }
      |      ^
      |      )
   42 |     if (tmp != 0) isOk=false
      |     ~~
a.cc:38:9: note: to match this '('
   38 |     for (var p : m) {
      |         ^
a.cc:42:29: error: expected ';' before 'ans'
   42 |     if (tmp != 0) isOk=false
      |                             ^
      |                             ;
   43 |     ans = (isOk) ? "Yes" : "No";
      |     ~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
  int N; cin >> N;
  if (N%3 != 0) {
    cout << "No" << endl;
    return;
  }
  
  map<int, int> m;
  for (int i=0; i<N; i++) 
  {
    int a;cin >> a;
    m[a]++;
  }

  string ans;
  if (m.size() == 1) {
    ans = (m[0] == N) ? "Yes" : "No";
  } else if (m.size() == 2) 
  {
    bool isOk = true;
    for(var p : m)
    {
      if (p.first == 0) {
        if (p.second != N/3) isOk = false;
      } else {
        if (p.second != 2*N/3) isOk = false;
      }
      ans = (isOk) ? "Yes" : "No";
    }
  } else if (m.size() == 3) {
    bool isOk = true;
    int tmp = 0;
    for (var p : m) {
      if (p.second != N/3) isOk=false;
      tmp ^= p.first;
    }
    if (tmp != 0) isOk=false
    ans = (isOk) ? "Yes" : "No";
  }

  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   10 |     return;
      |     ^~~~~~
a.cc:26:9: error: 'var' was not declared in this scope
   26 |     for(var p : m)
      |         ^~~
a.cc:35:3: error: expected primary-expression before '}' token
   35 |   } else if (m.size() == 3) {
      |   ^
a.cc:34:6: error: expected ';' before '}' token
   34 |     }
      |      ^
      |      ;
   35 |   } else if (m.size() == 3) {
      |   ~   
a.cc:35:3: error: expected primary-expression before '}' token
   35 |   } else if (m.size() == 3) {
      |   ^
a.cc:34:6: error: expected ')' before '}' token
   34 |     }
      |      ^
      |      )
   35 |   } else if (m.size() == 3) {
      |   ~   
a.cc:26:8: note: to match this '('
   26 |     for(var p : m)
      |        ^
a.cc:35:3: error: expected primary-expression before '}' token
   35 |   } else if (m.size() == 3) {
      |   ^
a.cc:38:10: error: 'var' was not declared in this scope
   38 |     for (var p : m) {
      |          ^~~
a.cc:42:5: error: expected primary-expression before 'if'
   42 |     if (tmp != 0) isOk=false
      |     ^~
a.cc:41:6: error: expected ';' before 'if'
   41 |     }
      |      ^
      |      ;
   42 |     if (tmp != 0) isOk=false
      |     ~~
a.cc:42:5: error: expected primary-expression before 'if'
   42 |     if (tmp != 0) isOk=false
      |     ^~
a.cc:41:6: error: expected ')' before 'if'
   41 |     }
      |      ^
      |      )
   42 |     if (tmp != 0) isOk=false
      |     ~~
a.cc:38:9: note: to match this '('
   38 |     for (var p : m) {
      |         ^
a.cc:42:29: error: expected ';' before 'ans'
   42 |     if (tmp != 0) isOk=false
      |                             ^
      |                             ;
   43 |     ans = (isOk) ? "Yes" : "No";
      |     ~~~
Language: C++

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

using namespace std;

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define Decimal fixed << setprecision(20)
#define SHOWP(x) cerr<<"["<<(x).FI<<", "<<(x).SE<<"]";
#define SHOWX(x) cerr<<#x<<": "<<x<<endl;
#define SHOWVEC(v, e) REP(i, e) cerr << (v[i]) << ' '; cerr << endl;
#define SHOW2D(a, h, w) REP(i, h){REP(j, w)cerr<<setw(3)<<(a[i][j])<<' ';cerr<<endl;}
constexpr int INF = 1100000000;
constexpr long long LLINF = 1100000000000000000LL;
constexpr long long MOD = 1000000007;

typedef long long ll;
typedef pair<ll, ll> P;


int main()
{
  int N; cin >> N;
  map<int, int> mp;
  REP(i, N) {
    int a; cin >> a;
    mp[a]++;
  }
  vector<int> v;
  for (auto e : mp) v.push_back(e.SE);
  sort(ALL(v));
  if (mp[0] == N) {
    cout << "Yes" << endl;
  } else if (N % 3 == 0 && v[0] + v[1] + v[2] == N && v[0] == N/3 && v[1] == N/3 && v[2] == N/3) {
    cout << "Yes" << endl;
  } else if (N % 3 == 1 && v[0] + v[1] == N && && mp[0] == N/3 && v[1] == 2*N/3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:53: error: expected ')' before '[' token
   48 |   } else if (N % 3 == 1 && v[0] + v[1] == N && && mp[0] == N/3 && v[1] == 2*N/3) {
      |             ~                                       ^
      |                                                     )
a.cc:48:51: error: label 'mp' used but not defined
   48 |   } else if (N % 3 == 1 && v[0] + v[1] == N && && mp[0] == N/3 && v[1] == 2*N/3) {
      |                                                   ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n; cin>>n;
    vector <int> a(n);
    map <int,int> ma;
    for(int i=0;i<n;i++){
        cin>>a[i];
        ma[a[i]]++;
    }
    int cnt0=count(a.begin(), a.end(), 0);
    if(count(cnt == n) {cout<<"Yes"<<endl; return 0;}
    sort(a.begin(),a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    if(n/3 != 0) {cout<<"No"<<endl; return 0;}
    else{
        if(cnt0== n/3&&mp.size()==2) {cout<<"Yes"<<endl; return 0;}
        if(mp.size()==3){
            if(a[0]==(a[1]^a[2]) && a[1] == (a[2]^a[0]) && a[2] == (a[0]^a[1])) {cout<<"Yes"<<endl; return 0;}
        }
    }
    cout<<"No"<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: 'cnt' was not declared in this scope; did you mean 'cnt0'?
   12 |     if(count(cnt == n) {cout<<"Yes"<<endl; return 0;}
      |              ^~~
      |              cnt0
a.cc:13:28: error: expected ')' before ';' token
   13 |     sort(a.begin(),a.end());
      |                            ^
      |                            )
a.cc:12:7: note: to match this '('
   12 |     if(count(cnt == n) {cout<<"Yes"<<endl; return 0;}
      |       ^
a.cc:13:9: error: could not convert 'std::sort<__gnu_cxx::__normal_iterator<int*, vector<int> > >(a.std::vector<int>::begin(), a.std::vector<int>::end())' from 'void' to 'bool'
   13 |     sort(a.begin(),a.end());
      |     ~~~~^~~~~~~~~~~~~~~~~~~
      |         |
      |         void
a.cc:17:24: error: 'mp' was not declared in this scope; did you mean 'ma'?
   17 |         if(cnt0== n/3&&mp.size()==2) {cout<<"Yes"<<endl; return 0;}
      |                        ^~
      |                        ma
a.cc:18:12: error: 'mp' was not declared in this scope; did you mean 'ma'?
   18 |         if(mp.size()==3){
      |            ^~
      |            ma
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


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

  if(N%3 == 0){
    if(cnt.size() == 1){
      if(cnt[0] == N) cout << "Yes" << endl;
      else cout << "No" << endl;
    }
    else if(cnt.size() == 2){
      vector<pair<int,int>> v;
      FOR(it,cnt) v.emplace_back(*it);

      if(v[0].first == 0 && v[0].second == N/3) cout << "Yes" << endl;
      else cout << "No" << endl;
    }
    else if(cnt.size() == 3){
      vector<pair<int,int>> v;
      FOR(it,cnt) v.emplace_back(*it);

      if(v[0].second == v[1].second && v[1].second == v[2].second){
        int x = v[0].first;
        int y = v[1].first;
        int z = v[2].first;

        if(((x^y) == z && (x^z) == y) ||
           ((x^z) == y && (x^y) == z) ||
           ((y^z) == x && (y^x) == z) cout << "Yes" << endl;
        else cout << "No" << endl;
      }else{
        cout << "No" << endl;
      }
    }
    else cout << "No" << endl;

  }else{
    if(cnt[0] == N) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:38: error: expected ';' before 'cout'
   44 |            ((y^z) == x && (y^x) == z) cout << "Yes" << endl;
      |                                      ^~~~~
      |                                      ;
a.cc:45:9: error: expected primary-expression before 'else'
   45 |         else cout << "No" << endl;
      |         ^~~~
a.cc:44:61: error: expected ')' before 'else'
   44 |            ((y^z) == x && (y^x) == z) cout << "Yes" << endl;
      |                                                             ^
      |                                                             )
   45 |         else cout << "No" << endl;
      |         ~~~~                                                 
a.cc:42:11: note: to match this '('
   42 |         if(((x^y) == z && (x^z) == y) ||
      |           ^
Language: Java

import java.util.*;

public class Amondai {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
	
		int N = keyboard.nextInt();
		
		int[]A = new int[N];
		Set<Integer> sp = new HashSet<Integer>();
		
		for(int i = 0; i<N; i++) {
			A[i] = keyboard.nextInt();
			sp.add(A[i]);
		}
		
		boolean flag = false;  
	
//			Nが３の倍数個であるとき
		if(N % 3 == 0) {
//				aが３種類であるとき
			if(sp.size() == 3) {
//					a1^a2 == a3である、かつ各aの個数が等しい
				Integer[]a = sp.toArray(new Integer[0]);
				if((a[0]^a[1]) == a[2]) {
					Arrays.sort(A); 
					if(A[0] == A[N/3-1] && A[N/3] == A[2*N/3-1] && A[2*N/3] == A[N-1]) {
						flag = true;
					}
				}
			}else if(sp.size() == 2){
//				aが２種類であるとき
				Integer[]a = sp.toArray(new Integer[0]);
				if(a[0]== 0) {
					Arrays.sort(A); 
					if(A[0] == A[N/3-1] && A[N/3] == A[N-1]) {
						flag = true;
					}
				}
			}else if(sp.size() == 1){
//					aが1種類であるとき1、aは必ず０でないといけない
				if(A[0] == 0) {
					flag = true;
				}
			}
		}

		String ans = "";
		if(flag) {
			ans = "Yes";
		}else {
			ans = "No";
		}
		
		System.out.println(ans);
		keyboard.close();	
	}
}


Compiler output:
Main.java:3: error: class Amondai is public, should be declared in a file named Amondai.java
public class Amondai {
       ^
1 error
Language: C

#pragma GCC optimization_level 3
#include <iostream>
#include <cstdio>
#include <unordered_map>
#include <chrono>
using namespace std;
typedef long long ll;

ll i, j, k;
ll a, b;
double sec;

ll n;
ll arr[100005];
unordered_map<ll, ll> x;
unordered_map<ll, bool> mp;

unsigned long long xor64(void);

int main()
{
    
    scanf("%lld %lld", &n, &arr[0]);
    for (i = 1; i < n; i++) {
        scanf("%lld", &arr[i]);
        x[arr[i]]++;
    }

    for (int i = 0; i < 100000; i++) {
        int x = xor64() % (unsigned long long)(n - 1) + 1;
        int y = xor64() % (unsigned long long)(n - 1) + 1;

        {
            ll tmp = arr[x];
            arr[x] = arr[y];
            arr[y] = tmp;
        }
    }


    for (i = 1; i < n ; i++) {

        if (i >= 10000) {
            puts("No");
            return 0;
        }
        
        if (mp[arr[i]]) continue;
        
        unordered_map<ll, ll> tmp = x;

        a = arr[0];
        b = arr[i];
        tmp[b]--;

        for (j = 2; j < n; j++) {
            ll f = a ^ b;

            if (tmp[f]) {
                tmp[f]--;
                a = b;
                b = f;
            }
            else {
                mp[arr[i]] = true;
                break;
            }
        }

        if (!(j ^ n)) {
            if (arr[0] == (a ^ b) &&
                arr[i] == (b ^ arr[0])) {
                puts("Yes");
                return 0;
            }
            else {
                mp[arr[i]] = true;
            }
        }
    }

    puts("No");

    return 0;
}   


unsigned long long xor64(void) {
    static unsigned long long x = 88172645463325252ULL;
    
    x = x ^ (x << 13);
    x = x ^ (x >> 7);
    x = x ^ (x << 17);

    return x;
}



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

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

int main(){
  int n;
  cin >> n;
  vector<long long> data(n);
  long long a,b,c;
  for(int i=0; i<n; i++){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  int count = 0;
  a = data.at(0);
  
  for(int i=0; i<n-1; i++){
    if(data.at(i) != data.at(i+1)){
      count++;
      if(count == 1){
        b = data.at(i+1);
      }else if(count == 2){
        c = data.at(i+1);
      }
    }
  }
  
  if(count != 2){
    cout << "No" << endl;
    return 0;
  }
  
  long long tmp1 = a^b;
  
  if(tmp1 != c){
    cout << "No" << endl;
    return 0;
  }
  
  int counta=0,countb=0,countc=0;
  
  for(int i=0; i<n; i++){
    if(data.at(i) == a) counta++;
    if(data.at(i) == b) countb++;
    if(data.at(i) == c) countc++;
  }
  
  
  
  if(counta == countb && countb == countc){
    cout << "Yes" << endl;
  }else if(a == 0 && counta == n){
    cout << "Yes" << endl;
  }else if(a == 0 && counta * 2 == countb $$ count == 1){
    cout << "Yes" << endl;
  }else{
    cout << "No" <<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:42: error: expected ')' before '$$'
   53 |   }else if(a == 0 && counta * 2 == countb $$ count == 1){
      |           ~                              ^~~
      |                                          )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
using ll = long long;
using ull = unsigned long long;

int main(void)
{
    IOS
    int n; cin >> n;
    map<int,int> m;
    REP(i,n) {
        int x; cin >> x;
        auto it = m.find(x);
        if (it = m.end()) m[x] = 0;
        m[x]++;
    }

    bool ans = false;

    if (m.size() == 1 && m.begin()->first == 0) ans = true;

    if (n % 3 == 0) {
        if (m.size() == 2 ) {
            for(auto kv : m) {
                if (kv.first == 0) {
                    if (kv.second * 3 == n ) ans = true;
                }
            }
        } else if (m.size() == 3) {
            vector<int> k;
            vector<int> v;
            for(auto kv : m) {
                k.emplace_back(kv.first);
                v.emplace_back(kv.second);
            }
            if (v[0] == v[1] && v[1] == v[2]) {
                if ((k[2] ^ k[1]) == k[0]) ans = true;
                if ((k[2] ^ k[0]) == k[1]) ans = true;
                if ((k[0] ^ k[1]) == k[2]) ans = true;
            }
        }
    }

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

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: could not convert '(it = m.std::map<int, int>::end())' from 'std::_Rb_tree_iterator<std::pair<const int, int> >' to 'bool'
   19 |         if (it = m.end()) m[x] = 0;
      |             ~~~^~~~~~~~~
      |                |
      |                std::_Rb_tree_iterator<std::pair<const int, int> >
Language: C

#include <stdio.h>
#include <stdlib.h>

int compare(const void *a,const void *b){
  return *(int *)a - *(int *)b;
}

int main(){
  int n;
  int a[100000];
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  qsort(a,n,sizeof(int),compare);
  int s = n/3;
  int t = 2*s;
  if(a[0] == 0 && a[s-1] == 0){
    if(a[n-1] == 0){
      printf("Yes");
      return 0;
    }else if(a[s] == a[n-1]){
      printf("Yes");
      return 0;
    }
  }else if(a[0] == a[s-1] && a[s] == s[t-1] && a[t] == a[n-1]){
    if((a[0]^a[s]^a[t]) == 0){
      printf("Yes");
      return 0;
    }
  }
  printf("No");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:39: error: subscripted value is neither array nor pointer nor vector
   26 |   }else if(a[0] == a[s-1] && a[s] == s[t-1] && a[t] == a[n-1]){
      |                                       ^
Language: C++

#include<bits/stdc++.h>
int main(){
  int N;
  cin >> N;
  int a, tmp = 0;
  for(int i=0; i<N; ++i) cin >> a; tmp ^= a;
  if(tmp==0)printf("Yes\n");
  else printf("No\n");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    4 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=(a),i##Len_=(b);i<i##Len_;i++)
 

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

	string res = "No";

	vector <ll> a(1000000009,0);
	vector <ll> acnt(1000000009,0);

	bool zeroari = false;
	bool allzero = true;
	REP(i,N)
	{
		cin >> a[i];
		acnt[a[i]]++;
		
		if(a[i] != 0)
		{
			allzero = false;
		}
		else
		{
			zeroari = true;
		}
	}

	if(allzero)
	{
		cout << "Yes" << endl;
		return 0;
	}


	//3で割り切れなければ満たせない
	if(N % 3 == 0)
	{
		ll Nb3 = N/3;

		if(zeroari)
		{
			//zero-> Nb3枚
			REP(i,N)
			{
				if(a[i] != 0)
				{
					ll x = a[i];
					if(acnt[x] == 2 * Nb3 && acnt[0] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
		else
		{
			// x と y と x^y
			REP(i,N)
			{
				if(a[0] != a[i])
				{
					ll x = a[0];
					ll y = a[i];
					ll z = x^y;

					if(acnt[x] == Nb3 && acnt[y] == Nb3 && acnt[z] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
	}

	cout << res << endl;

}#include <iostream>
#include <vector>

using namespace std;
typedef long long ll;
#define REP(i,n) FOR(i,0,n)
#define FOR(i,a,b) for(ll i=(a),i##Len_=(b);i<i##Len_;i++)
 

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

	string res = "No";

	vector <ll> a(1000000009,0);
	vector <ll> acnt(1000000009,0);

	bool zeroari = false;
	bool allzero = true;
	REP(i,N)
	{
		cin >> a[i];
		acnt[a[i]]++;
		
		if(a[i] != 0)
		{
			allzero = false;
		}
		else
		{
			zeroari = true;
		}
	}

	if(allzero)
	{
		cout << "Yes" << endl;
		return 0;
	}


	//3で割り切れなければ満たせない
	if(N % 3 == 0)
	{
		ll Nb3 = N/3;

		if(zeroari)
		{
			//zero-> Nb3枚
			REP(i,N)
			{
				if(a[i] != 0)
				{
					ll x = a[i];
					if(acnt[x] == 2 * Nb3 && acnt[0] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
		else
		{
			// x と y と x^y
			REP(i,N)
			{
				if(a[0] != a[i])
				{
					ll x = a[0];
					ll y = a[i];
					ll z = x^y;

					if(acnt[x] == Nb3 && acnt[y] == Nb3 && acnt[z] == Nb3)
					{
						res = "Yes";
					}
					break;
				}
			}
		}
	}

	cout << res << endl;

}

Compiler output:
a.cc:88:2: error: stray '#' in program
   88 | }#include <iostream>
      |  ^
a.cc:88:3: error: 'include' does not name a type
   88 | }#include <iostream>
      |   ^~~~~~~
a.cc:97:5: error: redefinition of 'int main()'
   97 | int main()
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main()
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){

  string s;
  cin >> s;
  string key = "keyence";
  string k1 = (key.begin(), 2);
  int count = 0;
  int rest = 0;
  for(int i = 0; i < s.size() ; i++){
  	if(count < 2 && s.at(i) == key.at(rest)){
    	for(int j = rest; j < 7; j++){
        	if(i < s.size() && key.at(j) != s.at(i)){

              count += 1;
              rest = j;
              break;
            }
          rest = j;
          i++;
        }
    }
  }

  string out;
  out = (rest == 6)? "YES": "NO";
  cout << out <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: warning: ignoring return value of 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::begin() [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator]', declared with attribute 'nodiscard' [-Wunused-result]
    8 |   string k1 = (key.begin(), 2);
      |                ~~~~~~~~~^~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:960:7: note: declared here
  960 |       begin() _GLIBCXX_NOEXCEPT
      |       ^~~~~
a.cc:8:29: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
    8 |   string k1 = (key.begin(), 2);
      |                             ^
Language: C++

#include <bits/stdc++.h>

#define INF ll_MAX
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef std::pair<int,int> pii;

using namespace std;

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

    int n;
    cin >> n;

    bool ans = false;
    vector<int> a(n);
    map<int,int> mp;

    int c_zero = 0;
    REP(i,n){
        cin >> a[i];
        mp[a[i]]++;
        if(a[i] == 0)c_zero++;
    }

    //全ての帽子に書かれた数が０
    if(c_zero == n){
        cout << "Yes" << endl;
        return 0;
    }

    //xが書かれた帽子が(2N)/3枚、０が書かれた数がN/3枚
    if(n%3 == 0 && c_zero == n/3){
        for(auto p: mp){
            if(p.second == 2*n/3){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

    //x⊕y⊕z=0が成立するような３つの相異なる整数x,y,zが書かれた帽子がそれぞれN/3枚
    //x_0 == x_3より、xの種類が３より大きい場合は不成立
    // cout << mp.size() << endl;
    if(mp.size() == 3){
        int xyz = 0;
        bool f_xyz = true;
        for(auto p : mp){
            xyz ^= p.first;
            if(p.second != N/3)f_xyz = false;
        }
        if(f_xyz && xyz == 0){
            cout << "Yes" << endl;
            return 0;
        }
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:55:28: error: 'N' was not declared in this scope
   55 |             if(p.second != N/3)f_xyz = false;
      |                            ^
Language: Java

import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args)  {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		long[] a = new long[N];
		String[] tokens = in.readLine().split(" ");
		boolean allZero = true;
		for (int i = 0; i < N; ++i) {
			a[i] = Long.parseLong(tokens[i]);
			if (a[i] != 0L) {
				allZero = false;
			}
		}

		if (allZero) {
			System.out.println("Yes");
			return;
		}
		Map<Long, Integer> counts = new HashMap<>();
		for (int i = 0; i < N; ++i) {
			if (!counts.containsKey(a[i])) {
				counts.put(a[i], 1);
			} else {
				counts.put(a[i], counts.get(a[i]) + 1);
			}
		}
		if (counts.size() >= 4 || counts.size() == 1) {
			System.out.println("No");
			return;
		}

		if (counts.size() == 3) {
			List<Integer> nums = new ArrayList<>();
			nums.addAll(counts.values());
			Collections.sort(nums);
			if (nums.get(0) != nums.get(2)) {
				System.out.println("No");
				return;
			}
			List<Long> values = new ArrayList<>();
			values.addAll(counts.keySet());
			Collections.sort(values);
			long x = values.get(0);
			long y = values.get(1);
			long z = values.get(2);
			if ((x ^ y ^ z) == 0L) {
				System.out.println("Yes");
				return;
			} else {
				System.out.println("No");
				return;
			}
		} else { // counts == 2
			List<Long> keys = new ArrayList<>();
			keys.addAll(counts.keySet());
			Collections.sort(keys);
			if (keys.get(0) != 0L) {
				System.out.println("No");
			} else if ((counts.get(keys.get(0)) * 2) == counts.get(keys.get(1))) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
			return;
		}
	}

}

Compiler output:
Main.java:10: error: unreported exception IOException; must be caught or declared to be thrown
		int N = Integer.parseInt(in.readLine());
		                                    ^
Main.java:12: error: unreported exception IOException; must be caught or declared to be thrown
		String[] tokens = in.readLine().split(" ");
		                             ^
2 errors
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
  cout<<"Yes"<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:20: error: expected ';' before '}' token
    5 |   cout<<"Yes"<<endl
      |                    ^
      |                    ;
    6 | }
      | ~
Language: C++

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

int main(){
    int N;
    cin >> N;
    
    vector<int> A(N);
    map<int, int> list;
    
    for(int i = 0; i < N; ++i){
        cin >> A[i];
        list[A[i]]++;
    }
    
    int sp = 0;
    
    vector<int> cnt;
    vector<int> num;
    for(auto e : list){
        sp++;
        num.push_back(e.first);
        cnt.push_back(e.second);
    }
    
    if(sp == 1 && A[0] == 0){
        cout << "Yes" << endl;
        return 0;
    }
    
    
    
    if(N % 3 == 0)
    {
        if(sp == 2){
            if((num[0] == 0 && cnt[0] == N / 3) || (num[1] == 0 && cnt[1] == N / 3)){
                cout << "Yes" << endl;
                return 0;
            } else {
                cout << "No" << endl;
                return 0;
            }
        } else {
            if(((num[0] ^ num[1]) == num[2])){
                cout << "Yes" << endl;
                return 0;
            } else {
                cout << "No" << endl;
                reutnr 0;
            }
        }
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:17: error: 'reutnr' was not declared in this scope
   51 |                 reutnr 0;
      |                 ^~~~~~
Language: C++

#include <bits/stdc++.h>
const int mod=1e9+7;
using LL=long long;
using namespace std;
namespace ndifix{
template<class T> void sort(T &v){std::sort(v.begin(),v.end());}
template<class T> void rsort(T &v){std::sort(v.rbegin(),v.rend());}

}

int main(){
  int n;cin>>n;
  vector<int> a(n);for(int i=0;i<n;i++)cin>>a[i];
  set<int> s;
  for(int i=0;i<n;i++)s.insert(a[i]);
  ndifix::sort(a);

  if(s.size()==1){
    if(a[0]==0){cout<<"Yes"<<endl;return 0;}
    if(a[0]!=0){cout<<"No"<<endl;return 0;}
  }
  if(s.size()==2){
    if(n%3!=0){cout<<"No"<<endl;return 0;}
    int p,q,r;
    if(a[0]==a[2*n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+2*n/3);
    else if(a[n/3]==a[n-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin()+n/3,a.end());
    if(a[0]==a.back() && a[0]==0){cout<<"Yes"<<endl;return 0;}
    cout<<"No"<<endl;return 0;
  }
  if(s.size()==3){
    if(n%3!=0){cout<<"No"<<endl;return 0;}
    int p,q,r;
    p=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    q=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    r=a[0];
    if(a[0]!=a[n/3-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin(),a.begin()+n/3);
    if((p^q)==r){cout<<"Yes"<<endl;return 0;}
  }
  cout<<"No"<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: expected '}' before 'else'
   26 |     else if(a[n/3]==a[n-1]){cout<<"No"<<endl;return 0;}a.erase(a.begin()+n/3,a.end());
      |     ^~~~
a.cc:22:18: note: to match this '{'
   22 |   if(s.size()==2){
      |                  ^
a.cc: At global scope:
a.cc:30:3: error: expected unqualified-id before 'if'
   30 |   if(s.size()==3){
      |   ^~
a.cc:41:3: error: 'cout' does not name a type
   41 |   cout<<"No"<<endl;
      |   ^~~~
a.cc:42:3: error: expected unqualified-id before 'return'
   42 |   return 0;
      |   ^~~~~~
a.cc:43:1: error: expected declaration before '}' token
   43 | }
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
using namespace std;
#define N (1000000000+7)
typedef pair<int,int> P;
typedef long long ll;
int d[1010][1010];
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
int h,w;
char board[1010][1010];
bool check(int i, int j) {
	return (i >= 0) && (i <= h) && (j >= 0) && (j <= w) && (board[i][j] == '.');
}

int main(void){
    int n,sum=0;
    cin>>n;
    vector<int>a(n),number;
    set<int>s;
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
        number.push_back(a[i]);
        s.insert(a[i]);
    }
    if(sum==0){
        cout<<"Yes"<<endl;
        return 0;
    }
    if(s.size()==3){
        sum=0;
        if(n%3!=0){
            cout<<"No"<<endl;
            return 0;
        }
        for(auto itr=s.begin();itr!=s.end();++itr){
            sum^=(*itr);
            if(number.count(*itr)!=n/3){
                cout<<"No"<<endl;
                return 0;
            }
        }
        if(sum==0)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
        return 0;
    }
    if(s.size()==2){
        sum=0;
        int v[2]={0};
        for(auto itr=s.begin();itr!=s.end();++itr){
            v[sum]=number.count(*itr);
            sum++;
        }
        if(((v[0]==n/3)&&(v[1]==2*n/3))||((v[0]==n/3)&&(v[1]==2*n/3))){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: 'class std::vector<int>' has no member named 'count'
   44 |             if(number.count(*itr)!=n/3){
      |                       ^~~~~
a.cc:57:27: error: 'class std::vector<int>' has no member named 'count'
   57 |             v[sum]=number.count(*itr);
      |                           ^~~~~
Language: C++

#include<stdio.h>
int main(void){
  int i,a[100000],flag=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<n;i++){
    if(a[i]!=0){
      flag=1;
    }
  }
  if(flag==0){
    printf("Yes\n");
  }
  else if(n%3==0){
    printf("Yes\n");
  }
  else{
    printf("No\n");
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:15: error: 'n' was not declared in this scope
    4 |   scanf("%d",&n);
      |               ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
int main()
{
    int n;cin>>n;
    set<int>s;int tem;
    int s1=-1,s2=-1,s3=-1;
    int c1=1,c2=1,c3=1;
    REP(i,n){
        int fo=s.size();
        cin>>tem;s.insert(tem);
        if(s.size()>3){cout<<"No"<<endl;return 0;}
        if(fo==s.size())
        {   
            if(tem==s1)c1++;
            if(tem==s2)c2++;
            if(tem==s3)c3++;
        }else
        {
            if(s.size()==1)s1=tem;
            if(s.size()==2)s2=tem;
            if(s.size()==3)s3=tem;
        }
    }
    if(s.size()==3){
        if(!(c1==c2&&c2==c3)){cout<<"No"<<endl;return 0;}
        bitset<100>bs1=s1;
        bitset<100>bs2=s2;
        bitset<100>bs3=s3;
        bitset<100>temp=bs1^bs2;
        if(bs3!=temp){cout<<"No"<<endl;return 0;}
        cout<<"Yes"<<endl;return 0;
        }
    }
    else if(s.size()==2)
    {
        if(s1==0||s2==0)
        {
            if(s1==0&&c1*2==c2){cout<<"Yes"<<endl;return 0;}
            if(s2==0&&c2*2==c1){cout<<"Yes"<<endl;return 0;}
        }
    }
    else if(s.size()==1)
    {
        if(s1==0) cout<<"Yes"<<endl;return 0;
    }
    cout<<"No"<<endl;return 0;
}

Compiler output:
a.cc:51:5: error: expected unqualified-id before 'else'
   51 |     else if(s.size()==2)
      |     ^~~~
a.cc:59:5: error: expected unqualified-id before 'else'
   59 |     else if(s.size()==1)
      |     ^~~~
a.cc:63:5: error: 'cout' does not name a type
   63 |     cout<<"No"<<endl;return 0;
      |     ^~~~
a.cc:63:22: error: expected unqualified-id before 'return'
   63 |     cout<<"No"<<endl;return 0;
      |                      ^~~~~~
a.cc:64:1: error: expected declaration before '}' token
   64 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
int main(void){
  int n,ai,i,j,t=0,k=1;
  cin >> n;
  vector<P> ab;
  for (i=0;i<n;i++){
    cin >> ai;
    for (j=t-1;j>=0;j--) if (ab.at(j).first==ai) break;
    if (j>=0) ab.at(j).second++;
    else{
      t++;
      ab.push_back(P(ai,1));
    }
    if (t>3){
      cout << "No" << endl;
      return 0;
    }
  }
  if (ab.at(0)==P(0,n)){
    cout << "Yes" << endl;
    return 0;
  }
  sort(m.begin(),m.end());
  if (t==2 && ab.at(0)==P(0,n*2/3)){
    cout << "Yes" << endl;
    return 0;
  }
  if (t!=3){
    cout << "No" << endl;
    return 0;
  }
  int a,b,c;
  vector<int> m;
  for (i=0;i<3;i++){
    if (ab.at(i).second*3!=n){
      cout << "No" << endl;
      return 0;
    }
    m.push_back(ab.at(i).first);
  }
  for (i=0;i<31;i++){
    a=(m.at(0) & k);
    b=(m.at(1) & k);
    c=(m.at(2) & k);
    if (a+b+c!=2*k && a+b+c!=0) break;
    k*=2;
  }
  if (i==31) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:8: error: 'm' was not declared in this scope
   25 |   sort(m.begin(),m.end());
      |        ^