# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
697161 | noobnessOVERLOADED | Best Place (NOI17_bestplace) | C++14 | 90 ms | 3100 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<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 n;
cin >> n;
int arr[n];
int brr[n];
int a;
int b;
int ans;
int bns;
for(int i = 0; i<n; i++){
cin >> a >> b;
arr[i] = a;
brr[i] = b;
}
ans = median(arr,n);
bns = median(brr,n);
cout << ans << " " << bns;
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... |