码迷,mamicode.com
首页 >  
搜索关键字:贪心 区间覆盖    ( 7804个结果
hdu 4925 Apple Tree(贪心)
http://acm.hdu.edu.cn/showproblem.php?pid=4925 尽量让每棵苹果树周围都施肥,每次找到一个空地种上苹果树之后,使其周围的空地施肥,不再种苹果树。 #include #include #include #include #include #include #include #include #include #in...
分类:移动开发   时间:2014-08-08 16:17:46    阅读次数:260
UVA 1422 - Processor (二分+贪心+优先队列)
先对开始时间进行排序,在利用优先队列是结束时间早点先出队; 因为时间只有20000,我们可以去枚举每个单位时间,看要给分配给那个任务, 如果某个时间队列中还有结束时间大于枚举的时间,就跳出判断是在mid的右边。 #include #include #include #include #include #include #include using namespace std; ...
分类:其他好文   时间:2014-08-08 12:59:45    阅读次数:265
UVA 12124 UVAlive 3971 Assemble(二分 + 贪心)
先从中找出性能最好的那个数, 在用钱比较少的去组合,能组出来就表明答案在mid的右边,反之在左边, #include #include #include #include #include using namespace std; map vic;//以字符映射数字 int end,start; int num; int m,n; int sba,sbb; char na...
分类:其他好文   时间:2014-08-08 12:59:35    阅读次数:266
UVA10382- Watering Grass(区间覆盖问题)
题意:一块长l,宽w的长方形草坪,在其中心线的不同位置处装有n个点状的喷水装置。每个喷水装置i可将以它为中心,半径为ri的圆形区域润湿。请选择尽量少的喷水装置,把整个草坪全部润湿。 思路:变形的区间覆盖问题。其实我们只要将圆形转化为覆盖在草坪上的矩形即可。当半径ri #include #include #include #include #include using...
分类:其他好文   时间:2014-08-08 12:57:36    阅读次数:153
poj 1827 A Bunch Of Monsters 贪心(并查集优化)
Description Background  Jim is a brave explorer. One day, he set out for his next destination, a mysterious hill. When he arrived at the foot of the hill, he was told that there were a bunch of mons...
分类:其他好文   时间:2014-08-08 12:52:35    阅读次数:314
poj1827A Bunch Of Monsters(贪心)
题目链接: 啊哈哈,点我点我 题目意思: 给出n个怪物可以拿到卡片的范围和这个怪物对主人公造成的伤害。。然后求最后得到怪物对主人公的最小伤害。。 思路:对怪物造成的伤害从大到小排序,然后对n个怪物进行逐一枚举,枚举时对它的时间进行逆向枚举,然后没有被访问到的将其伤害降为0,最后统计一下即可。 题目: A Bunch Of Monsters Time Lim...
分类:其他好文   时间:2014-08-08 02:06:45    阅读次数:277
HDU 1789 Doing Homework again (贪心)
Doing Homework againTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6499Accepted Submission(s): 38...
分类:其他好文   时间:2014-08-08 01:56:45    阅读次数:296
【转】对于杭电OJ题目的分类
【好像博客园不能直接转载,所以我复制过来了。。】1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1、2、3、4、5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 ...
分类:其他好文   时间:2014-08-08 01:52:25    阅读次数:431
2014多校联合六(HDU 4923 HDU 4925 HDU 4927 HDU 4930)
HDU 4923 Room and Moor 题意:给出A序列 求满足题目所写的B序列 使得方差最小 思路:可以想到最后的结果中 B序列的值一定是一段一段的 那么我们可以类似贪心去搞 对于一段序列我们可以求出什么样的b值使得方差最小 即序列中1的个数除以序列长度 又因为B是单调的 可以用一个单调栈去模拟 复杂度远远小于n^2 不要被吓怕… HDU 4925 Apple Tree 题意:n*m的格子 要么种苹果 要么施化肥 施肥后的格子的相邻格子如果种了苹果 则苹果数翻倍 问最多...
分类:其他好文   时间:2014-08-07 23:21:55    阅读次数:339
HDU 4923 (贪心+证明)
Room and MoorProblem DescriptionPM Room defines a sequence A = {A1, A2,..., AN}, each of which is either 0 or 1. In order to beat him, programmer Moor...
分类:其他好文   时间:2014-08-07 22:53:15    阅读次数:293
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!