제출 #1006020

#제출 시각아이디문제언어결과실행 시간메모리
1006020devariaotaBest Place (NOI17_bestplace)C++17
100 / 100
35 ms2040 KiB
#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 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...