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>
#include <bits/stdc++.h>
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;
}
# | 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... |