摘要: "装箱问题" 01背包的变式,费用=价值。 阅读全文
posted @ 2019-05-09 21:10 Mystery_Sky 阅读(725) 评论(0) 推荐(0) 编辑
摘要: "完全背包问题" 完全背包模板题 cpp include include using namespace std; //Mystery_Sky //完全背包模板 define M 1010 int f[M], c[M], w[M]; int v, m, ans; int main() { scanf 阅读全文
posted @ 2019-05-09 20:57 Mystery_Sky 阅读(739) 评论(0) 推荐(1) 编辑
摘要: "采药" 01背包模板题。 阅读全文
posted @ 2019-05-09 20:55 Mystery_Sky 阅读(201) 评论(0) 推荐(0) 编辑
摘要: "01背包问题" 经典的01背包问题模板 这里提供两种做法: 阅读全文
posted @ 2019-05-09 20:53 Mystery_Sky 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: "最长公共子序列" cpp include include include using namespace std; //Mystery_Sky // define M 1000 string s1, s2; int len1, len2; int f[M][M], ans; int main() 阅读全文
posted @ 2019-05-09 20:51 Mystery_Sky 阅读(521) 评论(0) 推荐(0) 编辑
摘要: "最大子矩阵" 无脑操作题,由于n include using namespace std; //Mystery_Sky // define M 1000 int f[M][M], a[M][M]; int n, ans, maxn; int main() { scanf("%d", &n); fo 阅读全文
posted @ 2019-05-09 19:56 Mystery_Sky 阅读(643) 评论(1) 推荐(1) 编辑
摘要: "最大上升子序列和" "最长上升子序列" 的变式。 状态转移方程: if(ai aj) fi = max(fi, fj+ai) cpp include include using namespace std; //Mystery_Sky // define M 1010 int maxn, n; i 阅读全文
posted @ 2019-05-09 19:39 Mystery_Sky 阅读(411) 评论(0) 推荐(0) 编辑