Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;

int bsearch(int x,vector<int> c){
	int min=0;
	int max=c.size()-1;
	int mid;
	while(true){
		mid=(max+min)/2;
		if(c[mid]>=x) max=mid;
		else min=mid+1;
		if(max<=min) break;
	}
	if(max==c.size()-1 && c[max]<x) max++;
	return max;
}

int main(){
	int n; cin >> n;
	vector<int> a(n),b(n);
	for(int i=0;i<n;i++) cin >> a[i];
	for(int i=0;i<n;i++) cin >> b[i];
	/*
	vector<vector<int>> c;
	c=vector<vector<int>>(30,vector<int>(b.size()));
	for(int k=0;k<29;k++){
		for(int i=0;i<b.size();i++)	c[k][i]=b[i]%(1<<k+1);
		sort(c[k].begin(),c[k].end());
	}
	*/
	vector<int> bits(30,0);
	for(int i=0;i<n;i++){
		for(int k=0;k<30;k++){
			vector<int> c(n);
			for(int i=0;i<b.size();i++)	c[i]=b[i]%(1<<k+1);
			sort(c.begin(),c.end());
			int T=1<<k;
			/*
			int l=0,r=0;
			int ll=bsearch(T-a[i]%(T*2),c[k]);
			int lr=bsearch(2*T-a[i]%(T*2),c[k]);
			if(ll>c[k].size()) l=0;
			else if(ll==lr) l=0;
			else l=lr-ll;
			int rl=bsearch(3*T-a[i]%(T*2),c[k]);
			int rr=bsearch(4*T-a[i]%(T*2),c[k]);
			if(rl>c[k].size()) r=0;
			else if(rl==rr) r=0;
			else r=rr-rl;
			bits[k]+=l+r;
			*/
			auto it1=lower_bound(c[k].begin(),c[k].end(),T-a[i]%(T*2));
			auto it2=lower_bound(c[k].begin(),c[k].end(),2*T-a[i]%(T*2));
			auto it3=lower_bound(c[k].begin(),c[k].end(),3*T-a[i]%(T*2));
			auto it4=lower_bound(c[k].begin(),c[k].end(),4*T-a[i]%(T*2));
			bits[k]+=(it2-it1)+(it4-it3);
		}
	}
	int ans=0;
	for(int k=0;k<30;k++){
		ans+=((bits[k]%2)<<k);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:51: error: request for member 'begin' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   55 |                         auto it1=lower_bound(c[k].begin(),c[k].end(),T-a[i]%(T*2));
      |                                                   ^~~~~
a.cc:55:64: error: request for member 'end' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   55 |                         auto it1=lower_bound(c[k].begin(),c[k].end(),T-a[i]%(T*2));
      |                                                                ^~~
a.cc:56:51: error: request for member 'begin' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   56 |                         auto it2=lower_bound(c[k].begin(),c[k].end(),2*T-a[i]%(T*2));
      |                                                   ^~~~~
a.cc:56:64: error: request for member 'end' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   56 |                         auto it2=lower_bound(c[k].begin(),c[k].end(),2*T-a[i]%(T*2));
      |                                                                ^~~
a.cc:57:51: error: request for member 'begin' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   57 |                         auto it3=lower_bound(c[k].begin(),c[k].end(),3*T-a[i]%(T*2));
      |                                                   ^~~~~
a.cc:57:64: error: request for member 'end' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   57 |                         auto it3=lower_bound(c[k].begin(),c[k].end(),3*T-a[i]%(T*2));
      |                                                                ^~~
a.cc:58:51: error: request for member 'begin' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   58 |                         auto it4=lower_bound(c[k].begin(),c[k].end(),4*T-a[i]%(T*2));
      |                                                   ^~~~~
a.cc:58:64: error: request for member 'end' in 'c.std::vector<int>::operator[](((std::vector<int>::size_type)k))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   58 |                         auto it4=lower_bound(c[k].begin(),c[k].end(),4*T-a[i]%(T*2));
      |                                                                ^~~