![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
文章平均质量分 92
Dayline_
qaq
展开
-
Riverside Curio 题解
A - Riverside CurioArkady decides to observe a river for n consecutive days. The river’s water level on each day is equal to some real value.Arkady goes to the riverside each day and makes a mark on the side of the channel at the height of the water lev原创 2021-02-02 22:08:29 · 164 阅读 · 0 评论 -
背包问题
01背包:有n个重量为w,价值为v的物品,从这些物品中挑选出总重量不超过m的物品,求所有挑选方案中价值总和的最大值。无优化int n,m; //n表示几组数,m表示最多的重量int w[],v[]; //重量和价值int dp[m+5][m+5]; for(int i=0;i<n;i++){ for(int j=0;j<=m;j++) { if(j<w[i]) { dp[i+1][j]=dp原创 2020-07-21 20:09:25 · 171 阅读 · 0 评论