Language: C++

/* be name Khoda */
#include <bits/stdc++.h>
using namespace std;

const int MAX_BIT = 30, N = 200 * 1001;
int a[N], b[N], n, num_bit[MAX_BIT], a_bit[N], b_bit[N], ans;

void solve(int biti) {
	int t = (1 << (biti + 1));
	for (int i = 0; i < n; i++) {
		a_bit[i] = a[i] % t;
//		cout << a_bit[i] << " * * ";
	}
//	cout << endl;
	for (int i = 0; i < n; i++) {
		b_bit[i] = b[i] % t;
//		cout << b_bit[i] << "  &  ";
	}
//	cout << endl << endl;
//	sort(a_bit, a_bit + n);
	sort(b_bit, b_bit + n);
	int t2 = t / 2;
//	cout << t2 << " *** \n";
//	for (int i = 0; i < n; i++)
//		cout << a_bit[i] << "   ";
//	cout << endl;
//	for (int i = 0; i < n; i++)
//		cout << b_bit[i] << "  /  ";
//	cout << endl;
	for (int i = 0; i < n; i++) {
		int dif = t2 - a_bit[i],
			dif2 = t - a_bit[i];
		auto k = lower_bound(b_bit, b_bit + n, dif) - b_bit,
			 k2 = lower_bound(b_bit, b_bit + n, dif2) - b_bit;
//		cout << dif << "  **  " << dif2 << "  ^& ";
//		cout << k2 - k << " --- \n";
		num_bit[biti] += max(k2 - k, 0LL);
	}
	for (int i = 0; i < n; i++) {
		int dif = t2 - a_bit[i] + t,
			dif2 = t - a_bit[i] + t;
		auto k = lower_bound(b_bit, b_bit + n, dif) - b_bit,
			 k2 = lower_bound(b_bit, b_bit + n, dif2) - b_bit;
		num_bit[biti] += max(k2 - k, 0LL);
	}
//	cout << " ====>  "  << num_bit[biti] << endl;
}
	
int main() {
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	for (int i = 0; i < n; i++)
		cin >> b[i];
	for (int i = 0; i < MAX_BIT; i++) 
		solve(i);
	for (int i = 0; i < MAX_BIT; i++)
		ans += (num_bit[i] % 2 == 0 ? 0 : (1 << i));
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'void solve(int)':
a.cc:37:37: error: no matching function for call to 'max(long int, long long int)'
   37 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:37:37: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   37 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:37:37: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   37 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~
a.cc:44:37: error: no matching function for call to 'max(long int, long long int)'
   44 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:44:37: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   44 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:44:37: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   44 |                 num_bit[biti] += max(k2 - k, 0LL);
      |                                  ~~~^~~~~~~~~~~~~