# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
292451 | 7_7_7 | Prosjek (COCI18_prosjek) | C++17 | 1091 ms | 384 KiB |
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;
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";
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |