文章分类 -  背包dp

摘要:The title of this problem is familiar,isn't it?yeah,if you had took part in the "Rookie Cup" competition,you must have seem this title.If you haven't 阅读全文
posted @ 2024-02-17 16:08 shaoyufei 阅读(1) 评论(0) 推荐(0) 编辑
摘要:The aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become t 阅读全文
posted @ 2024-02-17 15:23 shaoyufei 阅读(5) 评论(0) 推荐(0) 编辑
摘要:一个旅行者有一个最多能用V公斤的背包,现在有n件物品,它们的重量分别是W1,W2,...,Wn,它们的价值分别为C1,C2,...,Cn。这些物品被划分为若干组,每组中的物品互相冲突,最多选一件。求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大。 输入格式 第一行:三个整数 阅读全文
posted @ 2024-02-17 15:00 shaoyufei 阅读(11) 评论(0) 推荐(0) 编辑
摘要:题目描述 设有1g、2g、3g、5g、10g、20g的砝码各若干枚(其总重<=1000g)。求出用这些砝码能称出的不同重量的个数,但不包括一个砝码也不用的情况。 输入格式 只有一行,共有六个数,一次为1g、2g、3g、5g、10g、20g砝码的个数 输出格式 只有一行,为称出不同重量的个数 样例 样 阅读全文
posted @ 2024-02-17 14:32 shaoyufei 阅读(22) 评论(0) 推荐(0) 编辑