Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <string>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <climits>
using namespace std;
 
#define int long long
 
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int N;
int a[200000], b[200000];
vector<int> table_0[30], table_1[30];
vector<int> table;
int ans[30];
 
signed 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 < N; i++) {
        bitset<30> bs(b[i]);
        for (int j = 0; j <= 28; j++) {
            if (bs[j] == 0) {
                table_0[j].push_back(b[i] % (1 << j));
            } else {
                table_1[j].push_back(b[i] % (1 << j));
            }
        }
    }
    for (int i = 0; i <= 28; i++) {
        sort(table_0[i].begin(), table_0[i].end());
        sort(table_1[i].begin(), table_1[i].end());
    }
    for (int i = 0; i < N; i++) {
        bitset<30> bs(a[i]);
        for (int j = 0; j < bs.size(); j++) {
            int c = (1 << j) - a[i] % (1 << j);
            int noncli_0 = lower_bound(table_0[j].begin(), table_0[j].end(),
                                       c) -
                           table_0[j].begin();
 
            int noncli_1 = lower_bound(table_1[j].begin(), table_1[j].end(),
                                       c) -
                           table_1[j].begin();
            if (bs[j] == 1) {
                ans[j] += noncli_0;
                ans[j] += table_1[j].size() - noncli_1;
            } else {
                ans[j] += noncli_1;
                ans[j] += table_0[j].size() - noncli_0;
            }
        }
    }
    int abc = 0;
    for (int i = 0; i <= 28; i++) {
        if (ans[i] % 2 == 1) {
            abc += 1 << i;
        }
    }
    cout << abc << endl;
}
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
 
int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int N;
int a[200000], b[200000];
vector<int> table_0[30], table_1[30];
vector<int> table;
int ans[30];
 
signed 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 < N; i++) {
        bitset<30> bs(b[i]);
        for (int j = 0; j <= 28; j++) {
            if (bs[j] == 0) {
                table_0[j].push_back(b[i] % (1 << j));
            } else {
                table_1[j].push_back(b[i] % (1 << j));
            }
        }
    }
    for (int i = 0; i <= 28; i++) {
        sort(table_0[i].begin(), table_0[i].end());
        sort(table_1[i].begin(), table_1[i].end());
    }
    for (int i = 0; i < N; i++) {
        bitset<30> bs(a[i]);
        for (int j = 0; j < bs.size(); j++) {
            int c = (1 << j) - a[i] % (1 << j);
            int noncli_0 = lower_bound(table_0[j].begin(), table_0[j].end(),
                                       c) -
                           table_0[j].begin();
 
            int noncli_1 = lower_bound(table_1[j].begin(), table_1[j].end(),
                                       c) -
                           table_1[j].begin();
            if (bs[j] == 1) {
                ans[j] += noncli_0;
                ans[j] += table_1[j].size() - noncli_1;
            } else {
                ans[j] += noncli_1;
                ans[j] += table_0[j].size() - noncli_0;
            }
        }
    }
    int abc = 0;
    for (int i = 0; i <= 28; i++) {
        if (ans[i] % 2 == 1) {
            abc += 1 << i;
        }
    }
    cout << abc << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:9: error: 'bitset' was not declared in this scope
   35 |         bitset<30> bs(b[i]);
      |         ^~~~~~
a.cc:13:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
   12 | #include <climits>
  +++ |+#include <bitset>
   13 | using namespace std;
a.cc:35:20: error: 'bs' was not declared in this scope; did you mean 'b'?
   35 |         bitset<30> bs(b[i]);
      |                    ^~
      |                    b
a.cc:49:9: error: 'bitset' was not declared in this scope
   49 |         bitset<30> bs(a[i]);
      |         ^~~~~~
a.cc:49:9: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>'
a.cc:49:20: error: 'bs' was not declared in this scope; did you mean 'b'?
   49 |         bitset<30> bs(a[i]);
      |                    ^~
      |                    b
/usr/include/stdint.h: At global scope:
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
a.cc:15:18: error: 'long long long' is too long for GCC
   15 | #define int long long
      |                  ^~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:55,
                 from a.cc:76:
/usr/include/c++/14/limits:1339:12: error: redefinition of 'struct std::numeric_limits<long long int>'
 1339 |     struct numeric_limits<long long>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/limits:1060:12: note: previous definition of 'struct std::numeric_limits<long long int>'
 1060 |     struct numeric_limits<int>
      |            ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/limits:1409:12: error: redefinition of 'struct std::numeric_limits<long long unsigned int>'
 1409 |     struct numeric_limits<unsigned long long>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/limits:1127:12: note: previous definition of 'struct std::numeric_limits<long long unsigned int>'
 1127 |     struct numeric_limits<unsigned int>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/shared_ptr_atomic.h:33,
                 from /usr/include/c++/14/memory:81,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56:
/usr/include/c++/14/bits/atomic_base.h: In function 'constexpr std::memory_order std::operator|(memory_order, __memory_order_modifier)':
/usr/include/c++/14/bits/atomic_base.h:105:24: error: expected primary-expression before '(' token
  105 |     return memory_order(int(__m) | int(__mod));
      |                        ^
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In function 'constexpr std::memory_order std::operator&(memory_order, __memory_order_modifier)':
/usr/include/c++/14/bits/atomic_base.h:111:24: error: expected primary-expression before '(' token
  111 |     return memory_order(int(__m) & int(__mod));
      |                        ^
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In function 'void std::atomic_thread_fence(memory_order)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In function 'void std::atomic_signal_fence(memory_order)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'bool std::atomic_flag::test_and_set(std::memory_order)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'bool std::atomic_flag::test_and_set(std::memory_order) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'void std::atomic_flag::clear(std::memory_order)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'void std::atomic_flag::clear(std::memory_order) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator++()':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator++() volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator--()':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator--() volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator+=(__int_type)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator+=(__int_type) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator-=(__int_type)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator-=(__int_type) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator&=(__int_type)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator&=(__int_type) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator|=(__int_type)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator|=(__int_type) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator^=(__int_type)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::operator^=(__int_type) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order)':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::load(std::memory_order) const':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::load(std::memory_order) const volatile':
a.cc:15:13: error: expected primary-expression before 'long'
   15 | #define int long long
      |             ^~~~
/usr/include/c++/14/bits/atomic_base.h: In member function 'std::__atomic_base<_IntTp>::__int_type std::__atomic_base<_IntTp>::exchange