摘要:
#include <iostream> #include <algorithm> #include <cstring> using namespace std; const int N = 110; int n, m; int s[N], f[N]; int v[N][N], w[N][N]; in 阅读全文
posted @ 2021-08-13 13:24
冯大善人
阅读(24)
评论(0)
推荐(0)
摘要:
题目链接 AcWing 5.多重背包问题II 二进制优化多重背包 二进制优化原理(不难证明) 对于一个整数S,不妨设 S = \((1101011)_{2}\) 为 7位2进制整数, 我们可以由{\({2^0,2^1,2^2,2^3,2^4,2^5,2^6,2^7}\)}(集合中的元素要么选,要么不 阅读全文
posted @ 2021-08-13 13:23
冯大善人
阅读(33)
评论(0)
推荐(0)
摘要:
题目链接AcWing 4.多重背包问题 朴素版 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 110; int n, m; int f[N][N]; //f 阅读全文
posted @ 2021-08-13 13:18
冯大善人
阅读(37)
评论(0)
推荐(0)
摘要:
题目链接 AcWing 3. 完全背包问题 朴素法 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; int n, m; int v, w; int 阅读全文
posted @ 2021-08-13 13:17
冯大善人
阅读(45)
评论(0)
推荐(0)
摘要:
题目链接 Acwing 2. 01背包 朴素版01背包 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; int n, m; int v, w; i 阅读全文
posted @ 2021-08-13 13:15
冯大善人
阅读(28)
评论(0)
推荐(0)
浙公网安备 33010602011771号