# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
292451 | 7_7_7 | Prosjek (COCI18_prosjek) | C++17 | 1091 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |