![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
背包
背包
VL——MOESR
ga
展开
-
【CLYZ集训】买棉花糖【分治】【背包】
题解原创 2023-02-06 16:22:02 · 297 阅读 · 0 评论 -
【YBTOJ进阶训练指导】购买商品【背包】【DFS】
dfs+背包原创 2022-03-09 20:06:31 · 226 阅读 · 0 评论 -
【YBTOJ进阶训练指导】求好感度【背包】【二进制拆分】
二进制+背包原创 2022-03-09 19:53:35 · 149 阅读 · 0 评论 -
【YBTOJ】宝物筛选
思路:就是一个多重背包模板codecodecode#include<iostream>#include<cstdio>using namespace std;int n, m;int tot, a[1000100], b[1000100];int f[10000100]; int main(){ scanf("%d%d", &n, &m); for(int i=1; i<=n; i++) { int s, w, v; ..原创 2021-07-08 19:11:58 · 101 阅读 · 0 评论 -
【YBTOJ】货币系统
思路:用一个类似筛的东西,把不可以表示的筛出来,那就是B的货币系统codecodecode#include<iostream>#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int t, n, a[100010], f[1000100];int main(){ scanf("%d", &t); while(t--) {..原创 2021-07-08 11:43:54 · 111 阅读 · 0 评论 -
【YBTOJ】采药问题
思路:模板背包codecodecode#include<iostream>#include<cstdio>using namespace std;int m, n;int w[1000100], v[1000100];int f[1000100];int main(){ scanf("%d%d", &m, &n); for(int i=1; i<=n; i++) scanf("%d%d", &w[i], &..原创 2021-07-07 21:38:45 · 83 阅读 · 0 评论