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;
int x =0;
int y = 0;
vector<int> xi;
vector<int> yi;
for(int i = 0;i<n;i++){
int a;
int b;
cin >> a>>b;
xi.push_back(a);
yi.push_back(b);
}
sort(xi.begin(),xi.end());
sort(yi.begin(),yi.end());
if (n%2 == 0){
x = round((xi[n/2 - 1] + xi[n/2])/2.0);
y = round((yi[n/2 - 1] + yi[n/2])/2.0);
}
else{
x = xi[n/2];
y = yi[n/2];
}
cout << x<<" "<<y<<endl;
}
# | 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... |