版本比较
12-10 DP总结
正文
增加 3 行删除 3 行
5 行未改动678910101112131490 行未改动105106107108109109110111112113181 行未改动全部展开2952962972982992993003013023033045 行未改动
属实是惨不忍睹### 题目#### [木棍加工](https://www.luogu.com.cn/problem/P1233?contestId=296833)wow,我竟然把最长上升子序列的状态转移方程写错了?! 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); 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]) if (dp[n][i]) ans++; cout << ans << '\n'; return 0;}```