随笔分类 -  背包

摘要:1 #include 2 const int N=110; 3 using namespace std; 4 int n,m; 5 6 struct Rice{ 7 int price; 8 int weight; 9 int number;10 }rice[N];11 ... 阅读全文
posted @ 2015-03-23 21:31 UsedRose 阅读(152) 评论(0) 推荐(0)
摘要:1 #include 2 #include 3 int a[102],c[102],dp[100005]; 4 int max(int a,int b) 5 { 6 return a>b?a:b; 7 } 8 void CompletePack(int v,int w,int m) //完... 阅读全文
posted @ 2014-12-13 23:48 UsedRose 阅读(138) 评论(0) 推荐(0)
摘要:最基础的DP 1 #include "iostream" 2 #include "cstdio" 3 #include "string" 4 using namespace std; 5 #define MAXN 222222 6 int c[MAXN],v[MAXN]; 7 int dp[MAXN... 阅读全文
posted @ 2014-12-13 23:32 UsedRose 阅读(132) 评论(0) 推荐(0)