제출 #692813

#제출 시각아이디문제언어결과실행 시간메모리
692813zeroesandonesBest Place (NOI17_bestplace)C++17
100 / 100
42 ms3800 KiB
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;

#define FOR(i, j, k) for (ll i = j; i < (ll) k; ++i)
#define FORD(i, j, k) for (ll i = j; i >= (ll) k; --i)
#define nl "\n"
#define sp " "

#define all(x) (x).begin(), (x).end()
#define sc second
#define fr first
#define pb push_back

void solve() {
	ll n;
	cin >> n;

	ll x[n], y[n];

	FOR(i, 0, n) {
		cin >> x[i] >> y[i];
	}

	sort(x, x + n);
	sort(y, y + n);

	ll ansX, ansY;
	if(n % 2 == 0) {
		ansX = (x[n / 2] + x[n / 2 - 1]) / 2;
		ansY = (y[n / 2] + y[n / 2 - 1]) / 2;
	} else {
		ansX = x[n / 2];
		ansY = y[n / 2];
	}

	cout << ansX << sp << ansY << nl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}
#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...