# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
81687 | farukkastamonuda | XOR Sum (info1cup17_xorsum) | C++14 | 1209 ms | 62936 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define lo long long
#define inf 1000000000
#define md 1000000007
#define li 1000005
#define mp make_pair
#define pb push_back
#define pi pair<lo int, int>
using namespace std;
lo int n,A[li],c[li],t,gg,sum;
int main(){
scanf("%lld",&n);
for(int i=1;i<=n;i++) scanf("%lld",&A[i]);
for(int i=0;i<=30;i++){
int b=(1<<i);
t=0;
gg=0;
if(i){
for(int j=1;j<=n;j++){
if((A[j]|(1<<(i-1)))!=A[j]) c[++t]=A[j];
}
}
if(i){
for(int j=1;j<=n;j++){
if((A[j]|(1<<(i-1)))==A[j]) c[++t]=A[j];
}
}
if(i){
for(int j=1;j<=n;j++){
A[j]=c[j];
c[j]%=b;
}
}
for(int j=1;j<=n;j++){
if((A[j]|b)==A[j]) gg++;
}
lo int t1=1,t2=n,k=0;
while(t1<=n){
while(c[t1]+c[t2]>=b) {t2--;}
k+=n-t2;
t1++;
}
for(int j=1;j<=n;j++){
if(c[j]*2>=b) k++;
}
if((k/2+gg*(n-gg))%2==1) sum+=b;
}
printf("%lld\n",sum);
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |