제출 #676471

#제출 시각아이디문제언어결과실행 시간메모리
676471penguin133Best Place (NOI17_bestplace)C++17
100 / 100
119 ms4016 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...