Language: C++


#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string.h>
#include<vector>
#include<algorithm>
#define ll __int64
#define maxn 110000
using namespace std;

vector<ll>q[2];
ll x[maxn],y[maxn];
ll bit[100];
int n;

ll solve()//我擦。。这个归并太吊了
{
    ll ans=0;
    for(ll i=0;i<62;i++)
    {
        ll tot=0;
        q[0].clear();q[1].clear();
        for(ll j=1;j<=n;j++)
            q[(x[j]>>i)&1].push_back(x[j]);
        for(ll j=0;j<q[0].size();j++)
            x[++tot]=q[0][j];
        for(ll j=0;j<q[1].size();j++)
            x[++tot]=q[1][j];
        tot=0;
        q[0].clear();q[1].clear();
        for(ll j=1;j<=n;j++)
            q[(y[j]>>i)&1].push_back(y[j]);
        for(ll j=0;j<q[0].size();j++)
            y[++tot]=q[0][j];
        for(ll j=0;j<q[1].size();j++)
            y[++tot]=q[1][j];
        ll len1=1,len2=1,len3=1;
        ll limit1=1ll<<i;
        ll limit2=1ll<<(i+1);
        ll all=(1ll<<(i+1))-1;///这里加1LL
//        cout<<all<<" all"<<endl;
        ll sum=0;
//        for(int i=1;i<=tot;i++) cout<<x[i]<<" ";
//        cout<<endl;
//        for(int i=1;i<=tot;i++) cout<<(x[i]&all)<<" ";
//        cout<<endl;
//        for(int i=1;i<=tot;i++) cout<<y[i]<<" ";
//        cout<<endl;
        for(ll i=n;i>=1;i--)
        {
            while((((x[i]&all)+(y[len1]&all))<limit1) && (len1<=n)) len1++;//这里多加几个（）
            while((((x[i]&all)+(y[len2]&all))<limit2) && (len2<=n)) len2++;
            while(((x[i]&all)+(y[len3]&all)<limit1+limit2) && (len3<=n)) len3++;//cout<<(x[i]&all)<<" "<<(y[len3]&all)<<" "<<len3<<" "<<y[len3]<<" "<<(limit1+limit2)<<endl;
            sum+=n-(len1-1-len2+1+len3-1);
//            cout<<len1<<" "<<len2<<" "<<len3<<endl;
//            cout<<n-(len1-1-len2+1+len3-1)<<endl;
        }
//        cout<<sum<<" sum   "<<i<<endl;
        if(sum&1) ans+=bit[i];
    }
    return ans;
}

int main()
{
//    freopen("1003.txt","r",stdin);
    bit[0]=1;
    for(ll i=1;i<=61;i++)
    bit[i]=bit[i-1]*2;
        scanf("%I64d",&n);
        for(ll i=1;i<=n;i++)
            scanf("%I64d",&x[i]);
        for(ll i=1;i<=n;i++)
            scanf("%I64d",&y[i]);
//        cout<<solve()<<endl;
       printf("%I64d\n",solve()) ;
}



Compiler output:
a.cc:9:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:13:8: note: in expansion of macro 'll'
   13 | vector<ll>q[2];
      |        ^~
a.cc:13:10: error: template argument 1 is invalid
   13 | vector<ll>q[2];
      |          ^
a.cc:13:10: error: template argument 2 is invalid
a.cc:9:12: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:14:1: note: in expansion of macro 'll'
   14 | ll x[maxn],y[maxn];
      | ^~
a.cc:9:12: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:15:1: note: in expansion of macro 'll'
   15 | ll bit[100];
      | ^~
a.cc:9:12: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:18:1: note: in expansion of macro 'll'
   18 | ll solve()//我擦。。这个归并太吊了
      | ^~
a.cc: In function 'int main()':
a.cc:69:5: error: 'bit' was not declared in this scope
   69 |     bit[0]=1;
      |     ^~~
a.cc:9:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:70:9: note: in expansion of macro 'll'
   70 |     for(ll i=1;i<=61;i++)
      |         ^~
a.cc:70:16: error: 'i' was not declared in this scope
   70 |     for(ll i=1;i<=61;i++)
      |                ^
a.cc:9:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:73:13: note: in expansion of macro 'll'
   73 |         for(ll i=1;i<=n;i++)
      |             ^~
a.cc:73:20: error: 'i' was not declared in this scope
   73 |         for(ll i=1;i<=n;i++)
      |                    ^
a.cc:74:28: error: 'x' was not declared in this scope
   74 |             scanf("%I64d",&x[i]);
      |                            ^
a.cc:9:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    9 | #define ll __int64
      |            ^~~~~~~
a.cc:75:13: note: in expansion of macro 'll'
   75 |         for(ll i=1;i<=n;i++)
      |             ^~
a.cc:75:20: error: 'i' was not declared in this scope
   75 |         for(ll i=1;i<=n;i++)
      |                    ^
a.cc:76:28: error: 'y' was not declared in this scope
   76 |             scanf("%I64d",&y[i]);
      |                            ^
a.cc:78:25: error: 'solve' was not declared in this scope
   78 |        printf("%I64d\n",solve()) ;
      |                         ^~~~~