func_code_string: #include <bits/stdc++.h>   using namespace std;   using ll = long long;   const int N = 4e5 + 5;   const int BN = 25;   int n, a[N], cnt;   vector<int> v[BN];   int main() {     ios ::sync_with_stdio(0);     cin.tie(0);     cin >> n;     for (int i = 1; i <= n; ++i) {       cin >> a[i];     }     int res = 0;     for (int i = 1; i <= n; ++i) {       if (a[i] & 1) {         int k = (i - 1) - cnt;         if (k & 1) {           res ^= 1;         }       } else {         int k = cnt;         if (k & 1) {           res ^= 1;         }       }       int cur_val = (a[i] & 1);       for (int bit = 1; bit <= 24; ++bit) {         if ((a[i] >> bit) & 1) {           cur_val += (1 << bit);         }         v[bit].push_back(cur_val);       }       cnt += (a[i] & 1);     }     for (int bit = 1; bit <= 24; ++bit) sort(v[bit].begin(), v[bit].end());     for (int bit = 1; bit <= 24; ++bit) {       while (!v[bit].empty()) {         int cur_val = v[bit].back();         v[bit].pop_back();         int k = lower_bound(v[bit].begin(), v[bit].end(), (1 << bit) - cur_val) -                 v[bit].begin();         k = v[bit].size() - k;         int j = lower_bound(v[bit].begin(), v[bit].end(),                             (1 << (bit + 1)) - cur_val) -                 v[bit].begin();         j = v[bit].size() - j;         int l = lower_bound(v[bit].begin(), v[bit].end(),                             (1 << (bit + 1)) + (1 << bit) - cur_val) -                 v[bit].begin();         l = v[bit].size() - l;         k += l;         k -= j;         if (k & 1) {           res ^= (1 << bit);         }       }     }     cout << res;     return 0;   }   