![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
poj 1170 之二解
limchiang
这个作者很懒,什么都没留下…
展开
-
poj 1170 二解 之 背包
题目链接 题意“:有 b种商品 (0 c(1 , k(1 , p (1 (0 (1 c(编码),k(需购买数量)两个属性,最后是买这个方案中的所有商品给定的数量需要的总价格。问怎样选择优惠方案能最省钱? #include #include #include using namespace std; #define nMAX 6 /** 五维数组dp表示五种(或小于五种)商品各原创 2013-03-01 21:14:03 · 272 阅读 · 0 评论 -
poj 1170 二解 之 六进制状态压缩DP
题目链接 题意“:有 b种商品 (0 用压缩状态表示商品的数量 #include #include #include using namespace std; /** 一共有五种商品 */ #define nMAX 6 /** 六进制基数数组,用六进制是因为每种商品的个数在0 ~ 5 */ const int base[5] = { 1, 6, 36, 216, 1296 }原创 2013-03-01 21:51:33 · 272 阅读 · 0 评论