제출 #1011242

#제출 시각아이디문제언어결과실행 시간메모리
1011242AndrijaMMean (info1cup19_mean)C++14
30 / 100
1 ms604 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 200000;
const int maxv = 62 * 62;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    int x[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i];
    }
    int dp[n][n+1];
    memset(dp,0,sizeof dp);
    for(int i=0;i<n;i++)
    {
        dp[i][1]=x[i];
    }
    for(int len=2;len<=n;len++)
    {
        for(int i=0;i<n;i++)
        {
            for(int nL=1;nL<len;nL++)
            {
                dp[i][len]=max(dp[i][len],(dp[i][nL]+dp[i+nL][len-nL])/2);
            }
        }
    }
    cout<<dp[0][n]<<endl;
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...