# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
499825 | PothePanda | Best Place (NOI17_bestplace) | C++14 | 37 ms | 2656 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;
using ll = long long;
void solve(){
int n;
cin>>n;
int x[n];
int y[n];
int x_curr,y_curr;
for(int i =0;i<n;i++){
cin>>x[i]>>y[i];
}
sort(x,x+n);
sort(y,y+n);
if(n%2==1){
cout<<x[(n/2)]<<" "<<y[n/2];
}
else{
int x_1 = x[(n/2)-1]+x[(n/2)];
int y_1 = y[(n/2)-1]+y[(n/2)];
cout<<x_1/2<<" "<<y_1/2;
}
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
//cin>>t;
while(t--){
solve();
}
}
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... |