版本比较
12-10 DP总结
正文
增加 3 行删除 3 行
5 行未改动6789101112131490 行未改动105106107108109110111112113181 行未改动全部展开2952962972982993003013023033045 行未改动属实是惨不忍睹### 题目#### [木棍加工](https://www.luogu.com.cn/problem/P1233?contestId=296833)wow,我竟然把最长上升子序列的状态转移方程写错了?!错误代码```cpp#include <bits/stdc++.h>90 行未改动int n, m;cin >> n >> m;for (int i = 1; i <= m; i++)cin >> a[i] >> b[i];memset(dp, 0x3f, sizeof dp);dp[0] = 0;for (int i = 1; i <= m; i++){for (int j = a[i]; j <= n; j++)181 行未改动全部展开}}int ans = 0;for (int i = 1; i <= sum; i++)if (dp[n][i])ans++;cout << ans << '\n';return 0;}```5 行未改动6789101112131490 行未改动105106107108109110111112113181 行未改动全部展开2952962972982993003013023033045 行未改动属实是惨不忍睹### 题目#### [木棍加工](https://www.luogu.com.cn/problem/P1233?contestId=296833)wow,我竟然把最长上升子序列的状态转移方程写错了?!错误代码```cpp#include <bits/stdc++.h>90 行未改动int n, m;cin >> n >> m;for (int i = 1; i <= m; i++)cin >> a[i] >> b[i];memset(dp, 0x3f, sizeof dp);dp[0] = 0;for (int i = 1; i <= m; i++){for (int j = a[i]; j <= n; j++)181 行未改动全部展开}}int ans = 0;for (int i = 1; i <= sum; i++)if (dp[n][i])ans++;cout << ans << '\n';return 0;}```