# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
850488 | 2023-09-16T17:14:03 Z | AliHasanli | XOR Sum (info1cup17_xorsum) | C++17 | 686 ms | 17588 KB |
#include <bits/stdc++.h> using namespace std; int a[1000007],c[1000007]; int main() { int n,sol=0; scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); for(int j=0;j<31;j++) { int b=(1<<j),t=0; long long bc=0; if(j) for(int i=1;i<=n;i++) if((a[i] | (1<<(j-1)))!=a[i]) c[++t]=a[i]; if(j) for(int i=1;i<=n;i++) if((a[i] | (1<<(j-1)))==a[i]) c[++t]=a[i]; if(j) for(int i=1;i<=n;i++) {a[i]=c[i]; c[i]=a[i]%b;} for(int i=1;i<=n;i++) if((a[i] | b) == a[i]) bc++; long long k=0; int t1=1,t2=n; while(t1<=n) { while(c[t2]+c[t1]>=b) t2--; k+=(n-t2); t1++; } for(int i=1;i<=n;i++) if(2*c[i]>=b) k++; if((k/2+bc*(n-bc))%2==1) sol+=b; } printf("%d",sol); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 2396 KB | Output is correct |
2 | Correct | 4 ms | 2544 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 402 ms | 8020 KB | Output is correct |
2 | Correct | 373 ms | 12112 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 402 ms | 8020 KB | Output is correct |
2 | Correct | 373 ms | 12112 KB | Output is correct |
3 | Correct | 509 ms | 14980 KB | Output is correct |
4 | Correct | 488 ms | 14604 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 2396 KB | Output is correct |
2 | Correct | 4 ms | 2544 KB | Output is correct |
3 | Correct | 72 ms | 5672 KB | Output is correct |
4 | Correct | 72 ms | 5724 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 2396 KB | Output is correct |
2 | Correct | 4 ms | 2544 KB | Output is correct |
3 | Correct | 402 ms | 8020 KB | Output is correct |
4 | Correct | 373 ms | 12112 KB | Output is correct |
5 | Correct | 509 ms | 14980 KB | Output is correct |
6 | Correct | 488 ms | 14604 KB | Output is correct |
7 | Correct | 72 ms | 5672 KB | Output is correct |
8 | Correct | 72 ms | 5724 KB | Output is correct |
9 | Correct | 686 ms | 17452 KB | Output is correct |
10 | Correct | 674 ms | 17588 KB | Output is correct |
11 | Correct | 680 ms | 17576 KB | Output is correct |