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;
typedef long long ll;
int main(){
ll n;
cin >> n;
ll a,b;
priority_queue<ll>pq;
priority_queue<ll>pq2;
for(ll i=0;i<n;i++){
cin >> a >> b;
pq.push(a);
pq2.push(b);
}
if(n%2 == 0){
for(ll i=0;i<n/2-1;i++){
pq.pop();
pq2.pop();
}
ll d = pq.top();
pq.pop();
ll e = pq.top();
pq.pop();
d += e;
d /= 2;
cout << d << " ";
d = pq2.top();
pq2.pop();
e =pq2.top();
d += e;
d/=2;
cout << d;
}
else{
for(ll i=0;i<n/2;i++){
pq.pop();
pq2.pop();
}
cout << pq.top() <<" " << pq2.top();
}
}
# | 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... |