# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
696228 | igu | Best Place (NOI17_bestplace) | C++17 | 0 ms | 0 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.
#include<iostream>
using namespace std;
double median(int arr[], int size){
sort(arr, arr+size);
if (size % 2 != 0)
return (double)arr[size/2];
return (double)(arr[(size-1)/2] + arr[size/2])/2.0;
}
int main() {
int x;
cin >> x;
int ans;
int bns;
int a;
int b;
int arr[x];
int brr[x];
for (int i = 0; i < x; i++){
cin >> a >> b;
arr[i]=a;
brr[i]=b;
}
ans = median(arr,x);
bns = median(brr,x);
cout << ans << " " << bns;
return 0;
}