Submission #375503

# Submission time Handle Problem Language Result Execution time Memory
375503 2021-03-09T13:19:57 Z marat0210 Prosjek (COCI18_prosjek) C++14
20 / 50
1 ms 492 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());
    long double av1 = (a[0] + a[1]) / 2;
    long double av2 = (a[2] + av1) / 2;
    long double av3 = (a[3] + av2) / 2;
    if (n == 3) cout <<fixed<<setprecision(7)<<av2<<endl;
    else cout <<fixed<<setprecision(7)<<av3<<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 0 ms 364 KB Output is correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 0 ms 364 KB Output isn't correct
7 Incorrect 0 ms 364 KB Output isn't correct
8 Incorrect 1 ms 364 KB Output isn't correct
9 Incorrect 1 ms 364 KB Output isn't correct
10 Incorrect 1 ms 492 KB Output isn't correct