# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
672328 | hariaakas646 | Best Place (NOI17_bestplace) | C++14 | 41 ms | 3820 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int median(vector<int> vec) {
sort(vec.begin(), vec.end());
int s = vec.size();
if(s % 2 == 0) {
return (vec[s/2] + vec[s/2 - 1]) / 2;
}
else {
return vec[s/2];
}
}
int main()
{
int n;
scanf("%d", &n);
vector<int> X_vec(n), Y_vec(n);
for(int i = 0; i < n; i++) {
scanf("%d %d", &X_vec[i], &Y_vec[i]);
}
printf("%d %d", median(X_vec), median(Y_vec));
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |