Submission #159321

# Submission time Handle Problem Language Result Execution time Memory
159321 2019-10-22T10:50:48 Z mrtsima22 XOR Sum (info1cup17_xorsum) C++17
0 / 100
1600 ms 8172 KB
#include <bits/stdc++.h>
using namespace std;
const int M=6;
int n,a[1000004],b[1000004];
int c[39],ans;
int main(){
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++;
			}
		}
	}
	if(k&1){
		ans|=(1<<(i));
	}
}
int k=0;
for(int i=0;i<n;i++){
	if(a[i]&1) k++;
}
if((k*(n-k))&1){
	ans++;
}
cout<<ans<<endl;

}
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1657 ms 8172 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1657 ms 8172 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 58 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -