摘要:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1832 博弈类的DP,通过枚举较短一段的最大得分推出较长一段的最大得分。转移方程是 dp[i][j] = sum[i][j] - min(dp[i][i], dp[i][i + 1], ... , dp[i][j - 1], dp[i + 1][j], dp[i + 2][j], ... ,dp[j][j])。O(n^3)算法:View Code 1 #define REP(i, 阅读全文