Submission #159319

# Submission time Handle Problem Language Result Execution time Memory
159319 2019-10-22T10:45:01 Z mrtsima22 XOR Sum (info1cup17_xorsum) C++17
0 / 100
1600 ms 8188 KB
#include <bits/stdc++.h>
using namespace std;
const int M=30;
int n,a[1000004],b[1000004];
int c[39],ans;
int main(){
  ios::sync_with_stdio(false);
for(int i=1;i<=M;i++){
	c[i]=(1<<(i+1))-1;
}
cin>>n;
for(int i=0;i<n;i++){
	cin>>a[i];
}
for(int i=1;i<=M;i++){
	for(int j=0;j<n;j++){
		b[j]=c[i]&a[j];
	}
	sort(b,b+n);
	int b1=(1<<(i));
	int b2=((1<<(i+1))-1);
	int B1=b1+(1<<(i+1));
	int B2=((1<<(i+2))-2);
	int k=0;
	for(int o=0;o<n;o++){
		for(int O=o;O<n;O++){
			int bo=b[O]+b[o];
//			cout<<bo<<" "<<b1<<" "<<b2<<" "<<B1<<" "<<B2<<endl;
			if((bo>=b1&&bo<=b2)||(bo>=B1&&bo<=B2)){
				k++;
			}
		}
	}
//	cout<<k<<endl;
	if(k&1){
		ans|=(1<<(i));
	}

}
cout<<ans<<endl;

}
# Verdict Execution time Memory Grader output
1 Incorrect 276 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1666 ms 8188 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1666 ms 8188 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 276 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 276 ms 428 KB Output isn't correct
2 Halted 0 ms 0 KB -