Submission #917243

#TimeUsernameProblemLanguageResultExecution timeMemory
917243MateiKing80Mean (info1cup19_mean)C++14
100 / 100
3 ms760 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; #define int ll int dp[205][205]; //dp[i][j] cel mai mare numar care se poate obtine dupa ce facem operatii pe numerele de la i la j int v[205]; #define j i + lg signed main() { int n; cin >> n; for(int i = 1; i <= n; i ++) cin >> dp[i][i]; for(int lg = 1; lg < n; lg ++) for(int i = 1; i <= n - lg; i ++) for(int k = i; k < j; k ++) dp[i][j] = max(dp[i][j], (dp[i][k] + dp[k + 1][j]) / 2); cout << dp[1][n]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...