贪心
文章平均质量分 59
贪心问题
Marx_W
这个作者很懒,什么都没留下…
展开
-
HDU——1009 FatMouse' Trade (贪心水题)
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean. The warehouse has N rooms. The i-th room conta...原创 2018-04-20 19:08:55 · 253 阅读 · 0 评论 -
HDU——Doing Homework Again(贪心算法)
Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in ...原创 2018-04-22 19:25:42 · 816 阅读 · 2 评论 -
HDU——1114 Piggy-Bank(完全背包)
Problem DescriptionBefore 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 ...原创 2018-03-18 15:53:52 · 234 阅读 · 0 评论 -
贪心算法——删数问题(修改后)
要求:一个m位的数,去掉其中任意s个数,剩下的数按原次序组成一个新的数,要求编写程序是的重新组合的那个数最小。主要思路: 1、确定最高位:现在前s+1个数中找到最小的那个数,同时将所找到的这个数之前的数全部删掉。(因为删除s个数,所以最高位的那个数肯定在前s+1之中) 2、按同样的方法依次确定第i位数,但是数字比较的范围要缩小到从上一个确定的数后一位数到第s+i位数。(一共比较s原创 2017-03-27 19:59:37 · 2450 阅读 · 2 评论