久调wa,求调或hack
查看原帖
久调wa,求调或hack
720880
FlipWind楼主2024/1/23 21:49

rt,wssb

#include <bits/stdc++.h>
#define LL long long
using namespace std;
const LL phi = 1e7+14;
LL a[phi],b[phi];

int main()
{
    ios::sync_with_stdio(0);
    LL t;
    cin>>t;
    while(t--)
    {
        LL sum = 0,n,m;
        cin>>n>>m;
        for(LL i=1;i<=n;i++)    cin>>a[i];
        for(LL i=1;i<=m;i++)    cin>>b[i];
        LL f=1,be=1;
        for(LL i=1;i<=n;i++)
        {
            while(b[f]<a[i] && f<=m) f++;
            while(b[be]<=a[i] && be<=m) be++;
            sum ^= (be-f);
        }
        cout<<sum<<"\n";
        
    }
    return 0;
}
2024/1/23 21:49
加载中...