# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
48547 | 2018-05-15T22:37:00 Z | Pajaraja | XOR Sum (info1cup17_xorsum) | C++17 | 656 ms | 8372 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),bc=0,t=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=2*bc*(n-bc); 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)%2==1) sol+=b; } printf("%d",sol); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 616 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 557 ms | 8332 KB | Output is correct |
2 | Correct | 481 ms | 8332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 557 ms | 8332 KB | Output is correct |
2 | Correct | 481 ms | 8332 KB | Output is correct |
3 | Correct | 656 ms | 8372 KB | Output is correct |
4 | Correct | 637 ms | 8372 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 616 KB | Output is correct |
3 | Incorrect | 92 ms | 8372 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 376 KB | Output is correct |
2 | Correct | 6 ms | 616 KB | Output is correct |
3 | Correct | 557 ms | 8332 KB | Output is correct |
4 | Correct | 481 ms | 8332 KB | Output is correct |
5 | Correct | 656 ms | 8372 KB | Output is correct |
6 | Correct | 637 ms | 8372 KB | Output is correct |
7 | Incorrect | 92 ms | 8372 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |