#include <bits/stdc++.h>
using namespace std;
double res = 1e-10;
void rec(vector<double> a){
if((int)a.size() == 1){
res = max(res, a.back());
return;
}
for(int i = 0; i < (int)a.size(); i ++){
for(int j = i + 1; j < (int)a.size(); j ++){
vector<double> t;
for(int k = 0; k < (int)a.size(); k ++){
if(i == k || j == k) continue;
t.push_back(a[k]);
}
t.push_back((a[i] + a[j]) / 2.0);
rec(t);
}
}
}
int main()
{
ios_base::sync_with_stdio(false);
int n;
cin >> n;
vector<double> a;
for(int i = 1; i <= n; i ++){
int x;
cin >> x;
a.push_back(x);
}
rec(a);
cout << fixed << res << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
384 KB |
Output is correct |
4 |
Correct |
0 ms |
384 KB |
Output is correct |
5 |
Correct |
1 ms |
384 KB |
Output is correct |
6 |
Correct |
1 ms |
384 KB |
Output is correct |
7 |
Execution timed out |
1088 ms |
256 KB |
Time limit exceeded |
8 |
Execution timed out |
1053 ms |
384 KB |
Time limit exceeded |
9 |
Execution timed out |
1066 ms |
384 KB |
Time limit exceeded |
10 |
Execution timed out |
1091 ms |
384 KB |
Time limit exceeded |