Submission #500591

#TimeUsernameProblemLanguageResultExecution timeMemory
500591rajatshenoiBest Place (NOI17_bestplace)C++14
100 / 100
86 ms3080 KiB
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { 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...