Language: C++

#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define dump(x) cout<<" "<<#x<<"="<<x
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std;
using lint = long long;
using ld = long double;

int main(void) {
    lint n; cin >> n;
    vector<lint> a(n), b(n);
    repeat (i, n) cin >> a[i];
    repeat (i, n) cin >> b[i];
    
    auto pow2 = [](lint n) -> lint {
        return (1 << n);
    };
    
    auto fn = [](lint a, const vector<lint> &b, lint T) -> lint {
        lint x = max(0, T - a);
        lint y = 2 * T - 1 - a;
        lint z = 3 * T - a;
        lint w = 4 * T - 1 - a;
        auto itx = lower_bound(b.begin(), b.end(), x);
        auto ity = upper_bound(b.begin(), b.end(), y);
        auto itz = lower_bound(b.begin(), b.end(), z);
        auto itw = upper_bound(b.begin(), b.end(), w);
        //cout << "in fn "; dump(a); dump(T); dump(x); dump(y); dump(z); dump(w); dump(distance(itx, ity)); dump(distance(itz, itw)); vdump(b);
        return distance(itx, ity) + distance(itz, itw);
    };
    
    // k-bit目を決める
    lint ans = 0;
    repeat (k, 29) {
        vector<lint> amod(n), bmod(n);
        lint T = pow2(k);
        repeat (i, n) {
            amod[i] = a[i] % (T * 2);
            bmod[i] = b[i] % (T * 2);
        }
        sort(bmod.begin(), bmod.end());
        //vdump(bmod);
        lint cnt = 0;
        repeat (i, n) {
            lint t = fn(amod[i], bmod, T);
            cnt += t;
            //dump(k); dump(T); dump(i); dump(amod[i]); dump(t); dump(cnt); el;
        }
        if (cnt % 2 == 1) ans += T;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:28:21: error: no matching function for call to 'max(int, lint)'
   28 |         lint x = max(0, T - a);
      |                  ~~~^~~~~~~~~~
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:1:
/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:28:21: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'lint' {aka 'long long int'})
   28 |         lint x = max(0, T - a);
      |                  ~~~^~~~~~~~~~
/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:28:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   28 |         lint x = max(0, T - a);
      |                  ~~~^~~~~~~~~~