# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
785804 | mekybr | Best Place (NOI17_bestplace) | C++14 | 66 ms | 2992 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;
int main(){
int n,ansx,ansy,len;
cin>>n;
int coordx[n];
int coordy[n];
for(int x=0;x<n;x++){
int xi,yi;
cin>>xi>>yi;
coordx[x]=xi;
coordy[x]=yi;
}
len=sizeof(coordx)/sizeof(coordx[0]);
sort(coordx,coordx+n);
sort(coordy,coordy+n);
for(int y=0;y<n;y++){
if(n%2==0){
//ansx=((coordx[(n/2)-1]+coordx[(n/2)])/2);
//ansy=((coordy[(n/2)-1]+coordy[(n/2)])/2);
ansx=0.5*(coordx[(n/2)-1]+coordx[(n/2)]);
ansy=0.5*(coordy[(n/2)-1]+coordy[(n/2)]);
}
else{
ansx=coordx[((n+1)/2)-1];
ansy=coordy[((n+1)/2)-1];
}
}
cout<<ansx<<" "<<ansy;
}
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... |