Submission #507561

#TimeUsernameProblemLanguageResultExecution timeMemory
507561th111Best Place (NOI17_bestplace)C++14
100 / 100
107 ms2980 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; int x[N]; int y[N]; for (int i = 0; i < N; i++) { cin >> x[i]; cin >> y[i]; } sort(x, x + N); sort(y, y + N); int minx; int miny; if (N % 2 == 0) { minx = (x[N / 2 - 1] + x[(N + 1) / 2 - 1]) / 2; miny = (y[N / 2 - 1] + y[(N + 1) / 2 - 1]) / 2; } else { minx = x[N / 2]; miny = y[N / 2]; } cout << minx << " " << miny << "\n"; 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...