# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375513 | marat0210 | Prosjek (COCI18_prosjek) | C++14 | 1 ms | 512 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;
int main()
{
long double n;
cin >>n;
vector <long double> a(n);
for (int i = 0; i < n; ++i) {
cin >>a[i];
}
sort(a.begin(), a.end());
vector <long double> av(20);
av[0] = (a[0] + a[1]) / 2;
for (int i = 1; i < n - 1; ++i) {
long double cur = (a[i + 1] + av[i - 1]) / 2;
av[i] = cur;
}
cout <<fixed<<setprecision(7)<<av[n - 2]<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |