답안 #292451

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
292451 2020-09-07T02:13:04 Z 7_7_7 Prosjek (COCI18_prosjek) C++17
30 / 50
1000 ms 384 KB
#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";
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Execution timed out 1088 ms 256 KB Time limit exceeded
8 Execution timed out 1053 ms 384 KB Time limit exceeded
9 Execution timed out 1066 ms 384 KB Time limit exceeded
10 Execution timed out 1091 ms 384 KB Time limit exceeded