
贪心
文章平均质量分 83
Vmorish
这个作者很懒,什么都没留下…
展开
-
poj_1089Intervals
DescriptionThere is given the series of n closed intervals [ai; bi], where i=1,2,...,n. The sum of those intervals may be represented as a sum of closed pairwise non−intersecting intervals. The ta原创 2017-03-11 22:52:02 · 272 阅读 · 0 评论 -
Y2K Accounting Bug
DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data for preparing annual report for MS Inc. All what they remember is that MS Inc. posted原创 2017-03-12 14:29:15 · 380 阅读 · 0 评论 -
贪心基础题(区间调度问题+POJ_3617+POJ_3069)
贪心法就是遵循某种规则,不断贪心地选取当前最优策略的算法设计方法.(贪心法和动态规划的区别)1.区间调度问题Q:一共有n项工作,每项工作的起始时间分别为s[i],e[i],你可以自主选择是否参加每项工作,现在希望能够参加最多的工作(每项工作决定了参加就必须全程参与),先想知道最多能参加多少项工作?分析:这题的策略为贪心法,那么应该按照何种规则进行贪心呢?这里给出了四种贪心策略原创 2017-05-20 14:52:15 · 1121 阅读 · 0 评论 -
Balala Power(贪心)
hduoj好像挂了,就不给链接了哇...题意:给n个字符串,然后每个字母可以转化为其他的25个小写字母,字母a-z依次表示0-25,其中不同的两字母不能转化为相同的字母,让求转化后的字符串的总和最大.分析:根据每个字母对应所在位置的权值贪心...(看了标程才完全理清思路)参考代码:#include#include#include#include#includeusing原创 2017-07-26 10:48:05 · 456 阅读 · 0 评论 -
HDU - 4128 Running relay(贪心+凸包+三分)
HDU - 4128 Running relay(贪心+凸包+三分)Problem DescriptionThe school track-and-field team is taking a running relay race. There are n (2<=n<=104) members in the team. In order to let everybody participate in the race, each member should run at least d (0<=d<原创 2017-08-31 19:30:55 · 533 阅读 · 0 评论 -
CodeForces - 191A Dynasty Puzzles(dp)
The ancient Berlanders believed that the longer the name, the more important its bearer is. Thus, Berland kings were famous for their long names. But long names are somewhat inconvenient, so the Berlanders started to abbreviate the names of their kings. Th原创 2017-10-09 09:59:32 · 408 阅读 · 0 评论