摘要:
视频链接:https://www.bilibili.com/video/BV1ka4y1s7ER/ #include<iostream> #include<cstring> using namespace std; const int N=100010, M=110; int w[N], f[N][ 阅读全文
posted @ 2023-04-10 10:09
董晓
阅读(580)
评论(1)
推荐(1)
摘要:
视频链接:https://www.bilibili.com/video/BV1iK4y177jT/ #include<iostream> #include<cstring> using namespace std; const int N = 100010; int w[N],f[N][2]; in 阅读全文
posted @ 2023-04-10 10:08
董晓
阅读(645)
评论(0)
推荐(1)
摘要:
视频链接:https://www.bilibili.com/video/BV1TK4y1E7ft/ // 分步转移 #include<iostream> using namespace std; const int N=100010; int w[N],f[N]; int main(){ int n 阅读全文
posted @ 2023-04-10 10:06
董晓
阅读(699)
评论(1)
推荐(1)
摘要:
视频链接:https://www.bilibili.com/video/BV1454y1C7AR/ #include<iostream> #include<cstring> using namespace std; const int N = 1010; int v[N],w[N]; int f[N 阅读全文
posted @ 2023-04-10 10:05
董晓
阅读(643)
评论(0)
推荐(0)
摘要:
E19 背包DP 求方案数_哔哩哔哩_bilibili U224067 背包问题求方案数 - 洛谷 U636783 背包九题-背包问题求方案数 - 洛谷 // 不超背包容量的方案数 O(n*m) #include<bits/stdc++.h> using namespace std; const i 阅读全文
posted @ 2023-04-10 10:04
董晓
阅读(776)
评论(0)
推荐(2)
摘要:
视频链接:E18【模板】树上背包 P2014 [CTSC1997] 选课_哔哩哔哩_bilibili 题意:有 n 个物品和一个容量是 V 的背包。物品之间具有依赖关系,构成一棵树。如果选择一个物品,则必须选择它的父节点。 思路:在树上做背包DP 以每个结点为根的子树看做一个物品组,可能选择:只选根 阅读全文
posted @ 2023-04-10 10:03
董晓
阅读(1505)
评论(1)
推荐(2)
摘要:
E17【模板】树形DP P1352 没有上司的舞会_哔哩哔哩_bilibili P1352 没有上司的舞会 - 洛谷 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int 阅读全文
posted @ 2023-04-10 10:02
董晓
阅读(1152)
评论(0)
推荐(0)
摘要:
E16 背包DP 分组背包_哔哩哔哩_bilibili // 分组背包 朴素算法 #include<iostream> #include<cstring> using namespace std; const int N=110; int v[N][N],w[N][N],s[N]; // v[i,j 阅读全文
posted @ 2023-04-10 10:01
董晓
阅读(1001)
评论(1)
推荐(2)
摘要:
E15 背包DP 二维费用背包_哔哩哔哩_bilibili //二维费用 01背包 #include<iostream> using namespace std; int n,V,W; int f[110][110]; // f[j,k]:前i个物品,体积≤j,重量≤k 的最大价值 int main 阅读全文
posted @ 2023-04-10 09:59
董晓
阅读(673)
评论(0)
推荐(0)
摘要:
E14 背包DP 混合背包_哔哩哔哩_bilibili #include <iostream> using namespace std; const int N=1010,M=10000; int a[M],b[M],c[M]; int f[N]; int main(){ int n, m, v, 阅读全文
posted @ 2023-04-10 09:58
董晓
阅读(884)
评论(0)
推荐(3)
浙公网安备 33010602011771号