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 <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
vector<int> x;
vector<int> y;
for(int i = 0 ; i < n ; i++){
int a,b;
cin>>a>>b;
x.push_back(a);
y.push_back(b);
}
sort(x.begin(),x.end());
sort(y.begin(),y.end());
if(n%2!=0){
cout << x[(n-1)/2] << " " << y[(n-1)/2];
}else{
int ansx,ansy;
int a = x[(n/2) - 1], b = x[(n/2)] , c = y[(n/2) - 1] , d = y[(n/2)];
if (b-a <= 1) {
ansx = a;
}else{
ansx = a + 1;
}
if (d-c <= 1) {
ansy = c;
}else{
ansy = c + 1;
}
cout<< ansx<< " "<<ansy;
}
return 0;
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |