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;
priority_queue<int> pq;
int main()
{
int n, a;
cin >> n;
for(int i = 1; i <= n; i ++)
cin >> a, pq.push(-a);
while(pq.size() > 1)
{
int x = pq.top();
pq.pop();
int y = pq.top();
pq.pop();
pq.push(-((- x - y) / 2));
}
cout << -pq.top();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |