摘要: 1 //01背包问题 2 #include 3 int w[20]; //重量 4 int p[20]; //价值 5 int c[20]; //选择 6 int bag; //背包承重 7 8 int select(int m,int b) 9 { 10 //有m个物品,背包还能承重b,第m个物品拿还是不拿? 11 //如果拿,则... 阅读全文
posted @ 2016-03-30 09:41 地中生木 阅读(396) 评论(0) 推荐(0)