2015年3月13日

分组背包问题描述与实现

摘要: #include int w[301][21]; int get_max(int a, int b){ if(a>=b) return a; else return b;}int main(void){ int tc, T; ... 阅读全文

posted @ 2015-03-13 17:43 木星来客 阅读(227) 评论(0) 推荐(0) 编辑

各种类型的背包问题

摘要: 转自http://blog.csdn.net/waterbuffalo/article/details/5556423P01: 01背包问题 题目 有N件物品和一个容量为V的背包。第i件物品的费用是c,价值是w。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 基本... 阅读全文

posted @ 2015-03-13 15:44 木星来客 阅读(594) 评论(0) 推荐(0) 编辑

导航