Sample Input
8
10 15 12 3 4 13 1 15
Sample Output
14
思路:
贪心,然后求不大于的值。
代码
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
#define endl '\n'
typedef long long ll;
double a[10004];
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; ++i)
cin >> a[i];
sort(a, a + n);
double s = a[0];
for (int i = 0; i < n; ++i)
{
s = (s + a[i]) * 1.0 / 2;
}
cout << floor(s) << endl;
return 0;
}