Language: C++

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

typedef long long ll;
 
int main(){
	
	int n ; cin>>n;
	vector<int>camels(n);
	for(int i = 0 ; i< n ; i++){
		int j ; cin>>j;
		camels[i]=j;
	}
	bool b = true;

	sort(camels.begin(),camels.end());
	if(n/3==0){

	for(int i = 0 ; i< camels.size();i++){
		set <int> gquiz1;  
		for(int j = 0 ; j< n/3 ; j++){
			if(i+j>camels.size()-1){
				b=false;
				break;
			}
			gquiz1.insert(camels[i+j]);
			
		}
		if(!b){
			break;
		}
		if(gquiz1.size()>1){
			b=false;
			break;
		}
		i=i+n/3-1;
	}

	
	set<int>xo;
	for(int i = 0 ; i< camels.size(); i++){
		xo.insert(camels[i]);
	}

	if(xo.size()==1){
		if(camels[0]==0){
			cout<<"Yes";
		}
	}
	else if(b){
		vector<string>binary(3);
		int maxlen=0;
		for(int i = 0 ; i< 3 ; i++){
			string bin = bitset<32>(camels[i]).to_string();
			binary[i]=bin;
			int binsize;
			for(int j = 0 ; j<32 ; j++){
				if(bin[j]=='1'){
					binsize=32-j;
					break;
				}
			}
			if(binsize>maxlen){
				maxlen=binsize;
			}
		}
	
		vector<int>counting(32,0);
		for(int i = 0 ; i< 3 ; i++){
			for(int j = 31 ; j>=32-maxlen ; j--){
				if(binary[i][j]=='1'){
					counting[j]++;
				}
			}
		}
		bool ans=true;
		for(int i = 31 ; i>=32-maxlen ; i--){
			if(counting[i]!=2){
				ans=false;
			}
			
		}
		
		if(ans){
			cout<<"Yes";
		}
		else{
			cout<<"No";
		}
	}
	else{
		cout<<"No";
	}
	}
	else{
		cout<<"No";
	}
	int l ; cin>>l;
	
}






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:9:17: error: 'cin' was not declared in this scope
    9 |         int n ; cin>>n;
      |                 ^~~
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<int>camels(n);
      |         ^~~~~~
a.cc:10:16: error: expected primary-expression before 'int'
   10 |         vector<int>camels(n);
      |                ^~~
a.cc:13:17: error: 'camels' was not declared in this scope
   13 |                 camels[i]=j;
      |                 ^~~~~~
a.cc:17:14: error: 'camels' was not declared in this scope
   17 |         sort(camels.begin(),camels.end());
      |              ^~~~~~
a.cc:17:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |         sort(camels.begin(),camels.end());
      |         ^~~~
      |         short
a.cc:21:17: error: 'set' was not declared in this scope
   21 |                 set <int> gquiz1;
      |                 ^~~
a.cc:21:22: error: expected primary-expression before 'int'
   21 |                 set <int> gquiz1;
      |                      ^~~
a.cc:27:25: error: 'gquiz1' was not declared in this scope
   27 |                         gquiz1.insert(camels[i+j]);
      |                         ^~~~~~
a.cc:33:20: error: 'gquiz1' was not declared in this scope
   33 |                 if(gquiz1.size()>1){
      |                    ^~~~~~
a.cc:41:9: error: 'set' was not declared in this scope
   41 |         set<int>xo;
      |         ^~~
a.cc:41:13: error: expected primary-expression before 'int'
   41 |         set<int>xo;
      |             ^~~
a.cc:43:17: error: 'xo' was not declared in this scope
   43 |                 xo.insert(camels[i]);
      |                 ^~
a.cc:46:12: error: 'xo' was not declared in this scope
   46 |         if(xo.size()==1){
      |            ^~
a.cc:48:25: error: 'cout' was not declared in this scope
   48 |                         cout<<"Yes";
      |                         ^~~~
a.cc:52:24: error: 'string' was not declared in this scope
   52 |                 vector<string>binary(3);
      |                        ^~~~~~
a.cc:52:31: error: 'binary' was not declared in this scope
   52 |                 vector<string>binary(3);
      |                               ^~~~~~
a.cc:55:31: error: expected ';' before 'bin'
   55 |                         string bin = bitset<32>(camels[i]).to_string();
      |                               ^~~~
      |                               ;
a.cc:56:35: error: 'bin' was not declared in this scope
   56 |                         binary[i]=bin;
      |                                   ^~~
a.cc:69:24: error: expected primary-expression before 'int'
   69 |                 vector<int>counting(32,0);
      |                        ^~~
a.cc:73:41: error: 'counting' was not declared in this scope
   73 |                                         counting[j]++;
      |                                         ^~~~~~~~
a.cc:79:28: error: 'counting' was not declared in this scope
   79 |                         if(counting[i]!=2){
      |                            ^~~~~~~~
a.cc:86:25: error: 'cout' was not declared in this scope
   86 |                         cout<<"Yes";
      |                         ^~~~
a.cc:89:25: error: 'cout' was not declared in this scope
   89 |                         cout<<"No";
      |                         ^~~~
a.cc:93:17: error: 'cout' was not declared in this scope
   93 |                 cout<<"No";
      |                 ^~~~
a.cc:97:17: error: 'cout' was not declared in this scope
   97 |                 cout<<"No";
      |                 ^~~~