版本比较
DP 真的没有你想象的那么难!
正文
增加 1 行删除 1 行
77 行未改动7879808182838485866 行未改动77 行未改动一维 dp [B3637 最长上升子序列](https://www.luogu.com.cn/problem/B3637) : $f_i=\sum_{j=1}^{i-1} f_j+1~(a_j < a_i)$二维 dp [P1002 [NOIP2002 普及组] 过河卒](https://www.luogu.com.cn/problem/P1002) : 设 $(dx,dy)$ 为过河卒能从这个点到达 $(i,j)$ 点的点(不会被马吃),则 $f_{i,j}=min \{ f_{dx,dy}+1\}$背包 dp [P1048 [NOIP2005 普及组] 采药](https://www.luogu.com.cn/problem/P1048) : $f_{i,j}=max\{f_{i-1,j-t_i}+w_i\}$区间 dp [P1775 石子合并(弱化版)](https://www.luogu.com.cn/problem/P1775) : $f_{l,r}=f_{l,k}+f_{k+1,r}+s_r-s_{l-1}$不难发现,我们只需要确定了状态,对于这种简单 dp 直接模拟就可以了!6 行未改动77 行未改动7879808182838485866 行未改动77 行未改动一维 dp [B3637 最长上升子序列](https://www.luogu.com.cn/problem/B3637) : $f_i=\sum_{j=1}^{i-1} f_j+1~(a_j < a_i)$二维 dp [P1002 [NOIP2002 普及组] 过河卒](https://www.luogu.com.cn/problem/P1002) : 设 $(dx,dy)$ 为过河卒能从这个点到达 $(i,j)$ 点的点(不会被马吃),则 $f_{i,j}=min \{ f_{dx,dy}+1\}$背包 dp [P1048 [NOIP2005 普及组] 采药](https://www.luogu.com.cn/problem/P1048) : $f_{i,j}=max\{f_{i-1,j-t_i}+w_i\}$区间 dp [P1775 石子合并(弱化版)](https://www.luogu.com.cn/problem/P1775) : $f_{l,r}=f_{l,k}+f_{k+1,r}+s_r-s_{l-1}$不难发现,我们只需要确定了状态,对于这种简单 dp 直接模拟就可以了!6 行未改动