
贪心算法
文章平均质量分 90
akxxsb
写写博客装装逼,存代码
展开
-
hdu 2037 今年暑假不AC
实际上就是选择不相交区间,先按右端点进行排序,再分别去掉包含的区间和相交的区间,这里区间的选择采用的是贪心的策略,模板题啊啊。#include#include#includestruct s{ int l; int r; int ok;};int cmp(const void *_a,const void *_b){ s *a=(s*)_a;s原创 2014-02-20 13:56:56 · 980 阅读 · 0 评论 -
HDU 4932 贪心
Miaomiao's GeometryTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 191 Accepted Submission(s): 38Problem DescriptionThere are原创 2014-08-10 23:19:16 · 1393 阅读 · 4 评论 -
UVA1614(贪心)
Hell on the MarketsTime Limit:3000MS Memory Limit:Unknown 64bit IO Format:%lld & %llu[Submit] [Go Back] [Status] Description Most financial institutions had原创 2014-10-11 15:38:13 · 1252 阅读 · 0 评论 -
ZOJ 3715 Kindergarten Election(枚举+贪心)
Kindergarten ElectionTime Limit: 2 Seconds Memory Limit: 65536 KBAt the beginning of the semester in kindergarten, the n little kids (indexed from 1 to n, for convenience) in class need原创 2014-12-19 18:28:25 · 1636 阅读 · 0 评论 -
Codeforces Round #290 (Div. 2)D
D. Fox And Jumpingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a game. In this game原创 2015-02-10 16:12:46 · 876 阅读 · 0 评论 -
贪心部分小结
UVA10382 最少区间覆盖,一块矩形草坪,中心处有一些喷水装置,装置坐标为xi,喷水半径为ri,求最少几个装置可以全部覆盖草坪,求出每个装置能覆盖的矩形,问题转化为最少区间覆盖问题,按区间左端点排序,保存下当前能覆盖到的最远点,从左端点在最远点的左边的区间中选择右端点最大的装置,然后更新最远点。http://acm.bnu.edu.cn/v3/problem_show.php?pid=18原创 2015-12-06 00:50:29 · 724 阅读 · 1 评论