Submission #375513

# Submission time Handle Problem Language Result Execution time Memory
375513 2021-03-09T13:27:23 Z marat0210 Prosjek (COCI18_prosjek) C++14
50 / 50
1 ms 512 KB
#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
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 512 KB Output is correct
10 Correct 1 ms 364 KB Output is correct