# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953127 | Pacybwoah | 양말 찾기 (KPI13_socks) | C++17 | 1 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<cstdio>
using namespace std;
int arr[32][2];
int main(){
int n;
scanf("%d",n);
int x,i;
for(i=0;i<32;i++) arr[i][0]=0,arr[i][1]=0;
int j;
for(i=0;i<n;i++){
scanf("%d",x);
x+=1000000001;
for(j=31;j>=0;j--){
if(x&(1<<j)) arr[j][1]^=x;
else arr[j][0]^=x;
}
}
for(i=0;i<32;i++){
if(arr[i][0]>0&&arr[i][1]>0){
arr[i][0]-=1000000001;
arr[i][1]-=1000000001;
printf("%d %d\n",(arr[i][0]<arr[i][1]?arr[i][0]:arr[i][1]),(arr[i][1]>arr[i][0]?arr[i][1]:arr[i][0]));
return 0;
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |