![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
dp
..........
小白程序猿一枚
专注于后端开发
展开
-
HDU-2546-饭卡(dp)
电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。Input多组数据。对于每组数据:第一行为正整数n,表示菜的...原创 2020-02-05 20:46:56 · 231 阅读 · 0 评论 -
HDU-1114 Piggy-Bank —DP最小装载
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple...原创 2020-02-03 21:29:31 · 199 阅读 · 0 评论 -
POJ1976A Mini Locomotive(dp 01背包)
A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads decided to distribut...原创 2019-08-11 15:50:19 · 296 阅读 · 0 评论 -
HDU 2191 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活(多重背包)
急!灾区的食物依然短缺!为了挽救灾区同胞的生命,心系灾区同胞的你准备自己采购一些粮食支援灾区,现在假设你一共有资金n元,而市场有m种大米,每种大米都是袋装产品,其价格不等,并且只能整袋购买。请问:你用有限的资金最多能采购多少公斤粮食呢?后记:人生是一个充满了变数的生命过程,天灾、人祸、病痛是我们生命历程中不可预知的威胁。月有阴晴圆缺,人有旦夕祸福,未来对于我们而言是一个未知数。那么,我...原创 2019-08-12 08:34:44 · 76 阅读 · 0 评论