이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define all(x) x.begin(), x.end()
ll n;
int oned(vector<ll> d) {
if (n%2 == 1) {
int mid = floor(n/2);
return d[mid];
} else {
int mid = floor(( (n/2) + (n/2) -1 )/2);
return d[mid];
}
return 0;
}
int solver() {
cin>>n ;
vector<ll> x(n), y(n);
for(int i = 0; i< n; i++) {
cin>> x[i] >> y[i];
}
sort(all(x)); sort(all(y));
if (equal(x.begin()+1 , x.end(), x.begin())) {
cout<< x[0] <<" "<< oned(y) << "\n";
return 0;
} else if(equal(y.begin()+1, y.end(), y.begin())) {
cout<< oned(x)<< " "<< y[0] << "\n";
return 0;
}
if (n%2 == 1) {
ll mX = x[n/2];
ll mY = y[n/2];
cout<< mX << " " << mY << "\n";
return 0;
} else {
int mid = floor(( (n/2) + (n/2) -1 )/2);
ll mX = x[mid];
ll mY = y[mid];
cout<< mX << " " << mY << "\n";
return 0;
}
return 0;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
solver();
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... |