背包
wtcl
这个作者很懒,什么都没留下…
展开
-
Optimal Coin Change(多重背包)
多重背包记录路径:记录路径就是从后往前看每个状态是由哪个状态转移过来的。 链接:http://icpc.upc.edu.cn/problem.php?cid=2590&pid=6 #include <iostream> #include <string.h> using namespace std; const int N=2010; int cnt[N]; int n,W; int w[N],v[N]; int dp[N][N]; int main() { int m,n原创 2020-10-05 19:08:40 · 95 阅读 · 0 评论 -
背包问题
1.01背包 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int dp[1010]; int v[1010]; int w[1010]; int main() { int n,V; cin>>...原创 2020-03-26 22:51:19 · 72 阅读 · 0 评论