답안 #375506

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
375506 2021-03-09T13:21:57 Z marat0210 Prosjek (COCI18_prosjek) C++14
30 / 50
1 ms 364 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;
    long double av4 = (a[4] + av3) / 2;
    if (n == 3) cout <<fixed<<setprecision(7)<<av2<<endl;
    else if (n == 4) cout <<fixed<<setprecision(7)<<av3<<endl;
    else cout <<fixed<<setprecision(7)<<av4<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 0 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 Incorrect 1 ms 364 KB Output isn't correct
8 Incorrect 1 ms 364 KB Output isn't correct
9 Incorrect 0 ms 364 KB Output isn't correct
10 Incorrect 0 ms 364 KB Output isn't correct