Submission #485823

#TimeUsernameProblemLanguageResultExecution timeMemory
485823mananBest Place (NOI17_bestplace)C++17
3 / 100
34 ms3804 KiB
#include <bits/stdc++.h>

using namespace std;

#define ll long long int
// Added
#define True true
#define False false
#define endl "\n"

void solve() {
    ll n;
    cin >> n;
    vector<ll> x(n);
    vector<ll> y(n);
    for (ll i = 0; i < n; ++i) cin >> x[i] >> y[i];
    ll md = (n % 2 == 0) ? n/2 : ((n-1)/2) + ((n+1)/2);
    std::sort(x.begin(), x.end());
    std::sort(y.begin(), y.end());
    cout << x[md] << " " << y[md] << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...