摘要: http://poj.org/problem?id=1276 1 #include 2 #include 3 const int N=1000020; 4 #define Max(a,b) (a)>(b)?(a):(b) 5 int dp[N],cash; 6 void ZeroOnePack(int cost)//01背包 7 { 8 for (int i = cash; i >= cost; i--) 9 {10 dp[i] = Max(dp[i],dp[i-cost]+cost);11 }12 }13 void ComplexPack(int ... 阅读全文
posted @ 2014-01-19 14:50 N_ll 阅读(175) 评论(0) 推荐(0)