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 int long long
#define pii pair<int, int>
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n;
cin >> n;
vector<pii> v(n);
int resx, resy;
for (int i = 0; i < n; i++)
cin >> v[i].first >> v[i].second;
sort(v.begin(), v.end());
if (n % 2 == 0)
resx = (v[n / 2 - 1].first + v[n / 2].first) / 2;
else
resx = v[n / 2].first;
sort(v.begin(), v.end(), [](pii &a, pii &b)
{ return a.second < b.second; });
if (n % 2 == 0)
resy = (v[n / 2 - 1].second + v[n / 2].second) / 2;
else
resy = v[n / 2].second;
cout << resx << " " << resy << endl;
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... |