Submission #491495

#TimeUsernameProblemLanguageResultExecution timeMemory
491495Ghost_in_the_WireBest Place (NOI17_bestplace)C++17
100 / 100
36 ms2104 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<long long> vi;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n;
    cin >> n;
    vi posx = {};
    vi posy = {};
    for (int i = 0; i < n; i++) {
        ll temp1, temp2;
        cin >> temp1 >> temp2;
        posx.push_back(temp1);
        posy.push_back(temp2);
    }
    sort(posx.begin(), posx.end());
    sort(posy.begin(), posy.end());
    if (n%2==0) cout << posx[n/2] << " " << posy[n/2] << "\n";
    else cout << posx[(n-1)/2] << " " << posy[(n-1)/2] << "\n";
}
#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...