uva10559 Blocks(DP 费用提前)

该题的难点在于费用的计算,需考虑未来能转移到的所有状态 用dp[l][r][next]表示l到r之间以及r之后与r同色的所有next个方块的最大费用和 #include <iostream> #include <cstdio> #include <cstring> using namespace std; int t,n,a[202],k,cnt; int dp[202][202][202]; s
相关文章
相关标签/搜索