Language: C++

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

//int a[100001];
int b[100001];
bool c[100001];

int main() {
	int N; cin >> N;
	vector<int> a[N]; 
	
	for (int i=0; i<N; i++) {
		int tmp;
		cin >> tmp;
		a.push_back(tmp);
		b[i] = 0;
		c[i] = false;
	}
	
  	int x = 0;
    for (int i=1; i<N; i++) {
        x ^= a[i];
    }
  	if (x != 0) {
        cout << "No" << endl;
        return 0;
    }
	
	sort(a.begin(), a.end());
	
	b[0] = a[0];
	c[0] = true;

  	int count = N-1;
	for (int j=1; j<N; j++) {
		for (int k=j+1; k<N; k++) {
			if (b[0]^a[j] == a[k]) {
				b[1] = a[k];
				b[2] = a[j];
				c[k] = true;
				c[j] = true;
				count -= 2;
			}
		}
	}
	
	for (int i=1; i<N-2; i++) {
		for (int j=1; j<N; j++) {
			if (c[j] == false) {
				if (b[i]^a[j] > b[i+1]) break;
				if (b[i]^a[j] == b[i+1]) {
					b[i+1] = a[j];
					c[j] = true;
					count -= 1;
				}
			}
		}
	}
	
    if (count > 0) {
      cout << "No" << endl;
      return 0;
    }

	if (b[0]^b[N-2]==b[N-1]) {	
		cout << "Yes" << endl;
	} else {
        cout << "No" << endl;
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:19: error: request for member 'push_back' in 'a', which is of non-class type 'std::vector<int> [N]'
   15 |                 a.push_back(tmp);
      |                   ^~~~~~~~~
a.cc:22:11: error: no match for 'operator^=' (operand types are 'int' and 'std::vector<int>')
   22 |         x ^= a[i];
      |         ~~^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
                 from a.cc:1:
/usr/include/c++/14/cstddef:178:3: note: candidate: 'constexpr std::byte& std::operator^=(byte&, byte)'
  178 |   operator^=(byte& __l, byte __r) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/cstddef:178:20: note:   no known conversion for argument 1 from 'int' to 'std::byte&'
  178 |   operator^=(byte& __l, byte __r) noexcept
      |              ~~~~~~^~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54:
/usr/include/c++/14/bits/ios_base.h:114:3: note: candidate: 'constexpr const std::_Ios_Fmtflags& std::operator^=(_Ios_Fmtflags&, _Ios_Fmtflags)'
  114 |   operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:114:48: note:   no known conversion for argument 2 from 'std::vector<int>' to 'std::_Ios_Fmtflags'
  114 |   operator^=(_Ios_Fmtflags& __a, _Ios_Fmtflags __b) _GLIBCXX_NOTHROW
      |                                  ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:164:3: note: candidate: 'constexpr const std::_Ios_Openmode& std::operator^=(_Ios_Openmode&, _Ios_Openmode)'
  164 |   operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:164:48: note:   no known conversion for argument 2 from 'std::vector<int>' to 'std::_Ios_Openmode'
  164 |   operator^=(_Ios_Openmode& __a, _Ios_Openmode __b) _GLIBCXX_NOTHROW
      |                                  ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ios_base.h:211:3: note: candidate: 'constexpr const std::_Ios_Iostate& std::operator^=(_Ios_Iostate&, _Ios_Iostate)'
  211 |   operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |   ^~~~~~~~
/usr/include/c++/14/bits/ios_base.h:211:46: note:   no known conversion for argument 2 from 'std::vector<int>' to 'std::_Ios_Iostate'
  211 |   operator^=(_Ios_Iostate& __a, _Ios_Iostate __b) _GLIBCXX_NOTHROW
      |                                 ~~~~~~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:176:
/usr/include/c++/14/future:189:18: note: candidate: 'constexpr std::launch& std::operator^=(launch&, launch)'
  189 |   inline launch& operator^=(launch& __x, launch __y) noexcept
      |                  ^~~~~~~~
/usr/include/c++/14/future:189:37: note:   no known conversion for argument 1 from 'int' to 'std::launch&'
  189 |   inline launch& operator^=(launch& __x, launch __y) noexcept
      |                             ~~~~~~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:198:
/usr/include/c++/14/charconv:654:3: note: candidate: 'constexpr std::chars_format& std::operator^=(chars_format&, chars_format)'
  654 |   operator^=(chars_format& __lhs, chars_format __rhs) noexcept
      |   ^~~~~~~~
/usr/include/c++/14/charconv:654:28: note:   no known conversion for argument 1 from 'int' to 'std::chars_format&'
  654 |   operator^=(chars_format& __lhs, chars_format __rhs) noexcept
      |              ~~~~~~~~~~~~~~^~~~~
a.cc:29:16: error: request for member 'begin' in 'a', which is of non-class type 'std::vector<int> [N]'
   29 |         sort(a.begin(), a.end());
      |                ^~~~~
a.cc:29:27: error: request for member 'end' in 'a', which is of non-class type 'std::vector<int> [N]'
   29 |         sort(a.begin(), a.end());
      |                           ^~~
a.cc:31:19: error: cannot convert 'std::vector<int>' to 'int' in assignment
   31 |         b[0] = a[0];
      |                ~~~^
      |                   |
      |                   std::vector<int>
a.cc:38:43: error: cannot convert 'std::vector<int>' to 'int' in assignment
   38 |                                 b[1] = a[k];
      |                                        ~~~^
      |                                           |
      |                                           std::vector<int>
a.cc:39:43: error: cannot convert 'std::vector<int>' to 'int' in assignment
   39 |                                 b[2] = a[j];
      |                                        ~~~^
      |                                           |
      |                                           std::vector<int>
a.cc:50:47: error: no match for 'operator>' (operand types are 'std::vector<int>' and 'int')
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                          ~~~~ ^ ~~~~~~
      |                                             |        |
      |                                             |        int
      |                                             std::vector<int>
In file included from /usr/include/c++/14/regex:68,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
 1176 |     operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
 1236 |     operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   'std::vector<int>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
 1329 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
 1403 |     operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
 1497 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
 1573 |     operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'int'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
 1673 |     operator>(const sub_match<_Bi_iter>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note:   template argument deduction/substitution failed:
a.cc:50:54: note:   'std::vector<int>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
   50 |                                 if (b[i]^a[j] > b[i+1]) break;
      |                                                      ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1058 |     operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~