摘要:
Farmer John wishes to build a fence to contain his cows, but he's a bit short on cash right. Any fence he builds must contain all of the favorite graz 阅读全文
摘要:
相当于在背包上面挂vector,这样我们就可以求出容量为j所有k优解 转移是把dp[i-1][j][k] 和 dp[i-1][j-w[i]][k]向dp[i][j][k]上转移,因为这两个地方的k优解的2k个解里一定含有dp[i][j]的k优解,而且这两个序列有单调性 可以直接把所有数赋为-inf然 阅读全文