-
Notifications
You must be signed in to change notification settings - Fork 2
/
B1070.cpp
30 lines (28 loc) · 1.05 KB
/
B1070.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*************************************************************************
> File Name: B1070.cpp
> Author: bumzy
> Mail: [email protected]
> Created Time: Tue 01 Aug 2017 09:02:03 PM CST
************************************************************************/
#include <stdio.h>
#include <queue>
using namespace std;
int main() {
priority_queue<double, std::vector<double>, std::greater<double> > Q;
int n;
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
double len;
scanf("%lf", &len);
Q.push(len);
}
while (Q.size() > 1) {
double t1 = Q.top();
Q.pop();
double t2 = Q.top();
Q.pop();
Q.push((t1 + t2) / 2.0);
}
printf("%d\n", (int) Q.top());
return 0;
}