Algorithm 寻找SPOJ上火星DP解决方案的失败测试案例
我正在努力解决这个问题 我的算法如下:Algorithm 寻找SPOJ上火星DP解决方案的失败测试案例,algorithm,dynamic-programming,Algorithm,Dynamic Programming,我正在努力解决这个问题 我的算法如下: 定义dp[i][j]=max可开采的矩形矿物量0,0到i,j 使用递归 dp[i][j] = max(dp[i-1][j] + total amount of yeyenum in the i-th row up to the j-th column, dp[i][j-1] + total amount of bloggium
dp[i][j]=max
可开采的矩形矿物量0,0到i,j
dp[i][j] = max(dp[i-1][j] + total amount of yeyenum
in the i-th row up to the j-th column,
dp[i][j-1] + total amount of bloggium
in the j-th column up to the cell i-th row)
4 4
0 0 10 60
1 3 10 0
4 2 1 3
1 1 20 0
10 0 0 0
1 1 1 10
0 0 5 3
5 10 10 10
0 0