#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++;
}
}
}
// cout<<k<<endl;
if(k&1){
ans|=(1<<(i));
}
}
cout<<ans<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
59 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1674 ms |
9308 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1674 ms |
9308 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
59 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
59 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |