제출 #491494

#제출 시각아이디문제언어결과실행 시간메모리
491494Ghost_in_the_WireBest Place (NOI17_bestplace)C++17
100 / 100
35 ms4068 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] << endl;
    else cout << posx[(n-1)/2] << " " << posy[(n-1)/2] << endl;
}
#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...