Submission #917237

#TimeUsernameProblemLanguageResultExecution timeMemory
917237MateiKing80Mean (info1cup19_mean)C++14
0 / 100
1 ms348 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]; signed main() { int n; cin >> n; for(int i = 1; i <= n; i ++) cin >> dp[i][i]; for(int i = 1; i <= n; i ++) for(int j = i + 1; j <= n; j ++) 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...