# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1109011 | vjudge1 | Best Place (NOI17_bestplace) | C++17 | 54 ms | 2320 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,m=n,med,med1;
cin>>n;
vector<int>v(n);
vector<int>s(n);
for(int i=0;i<n;++i){
int x,y;
cin>>v[x]>>s[y];
}
sort(v.begin(),v.end());
sort(s.begin(),s.end());
if(v.size()%2==0){
med=(v[v.size()/2-1]+v[v.size()/2])/2;
}
else{
med=v[v.size()/2];
}
if(s.size()%2==0){
med1=(s[s.size()/2-1]+s[s.size()/2])/2;
}
else{
med1=s[s.size()/2];
}
cout<<med<<" "<<med1;
}
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... |