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>
#define FIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long INT;
typedef vector<INT> ARR;
int main() {
FIO;
INT n;
cin >> n;
ARR x = {};
ARR y = {};
for (int i = 0; i < n; i++) {
INT temp1, temp2;
cin >> temp1 >> temp2;
x.push_back(temp1);
y.push_back(temp2);
}
sort(x.begin(), x.end());
sort(y.begin(), y.end());
INT ansx;
INT ansy;
if (n%2 == 0) {
ansx = x[n/2];
ansy = y[n/2];
}
else {
ansx = x[(n-1)/2];
ansy = y[(n-1)/2];
}
cout << ansx << " " << ansy << "\n";
}
# | 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... |