#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int ll
priority_queue<int> pq;
signed 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();
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |