码迷,mamicode.com
首页 >  
搜索关键字:poj 2393 贪心    ( 27395个结果
poj 2195 Going Home
DescriptionOn a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vert...
分类:其他好文   时间:2014-07-22 23:15:37    阅读次数:331
贪心算法
学习要点:1、概念2、基本要素(+与动态规划算法的差异)3、应用范例:(1)活动安排问题(2)最优装载问题(3)哈夫曼编码(4)最优服务次序问题(5)最小生成树(6)最大边权值最小的生成树(7).......1、概念贪心算法总是作出当前看来是最好的选择。也就是说贪心算法并不从整体最优上加以考虑,它所...
分类:其他好文   时间:2014-07-22 23:12:53    阅读次数:413
poj 3635 BFS+优先队列
1 /* 2 题意:给出n个地点,每个地点的油价为pi每单位,给出m条边,每条长度为d,行走d距离的路需 3 要d单位的油;给出一辆车的油箱容量以及起始点:s,e;问s到e最少要耗费多少钱 4 5 题解:BFS+优先队列 6 这个搜索方式比较巧妙:状态为对于当前点是走还是油+1,这样...
分类:其他好文   时间:2014-07-22 23:10:56    阅读次数:281
半平面交 模板 poj 3335 poj 3130 poj 1474 判断半平面交是否为空集
半平面交模板const double pi= acos(-1.0);#define arc(x) (x / 180 * pi)const double EPS = 1e-8;const int Max_N = 105;struct Point{ double x,y; Point(){}...
分类:其他好文   时间:2014-04-30 17:00:01    阅读次数:621
POJ 1236
Network of SchoolsTime Limit:1000MSMemory Limit:10000KTotal Submissions:10500Accepted:4189DescriptionA number of schools are connected to a computer n...
分类:其他好文   时间:2014-04-29 20:33:42    阅读次数:567
Codeforces Round #243 (Div. 2) C. Sereja and Swaps(优先队列 暴力)
题目题意:求任意连续序列的最大值,这个连续序列可以和其他的 值交换k次,求最大值思路:暴力枚举所有的连续序列。没做对是因为 首先没有认真读题,没看清交换,然后,以为是dp或者贪心用了一下贪心,各种bug不对。这次用了一下优先队列,以前用的不多,看这个博客又学了一下AC代码: 1 #include ....
分类:其他好文   时间:2014-04-29 17:14:46    阅读次数:432
poj 1274 The Perfect Stall
DescriptionFarmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, due to engineering probl...
分类:其他好文   时间:2014-04-29 16:46:46    阅读次数:371
poj 1279 求半平面交的 面积
poj 1279 求半平面交的 面积题目来源:http://poj.org/problem?id=1279分析: 求半平面交的 面积代码如下:const double EPS = 1e-8;const int Max_N = 1505;struct Point{ double x,y; ...
分类:其他好文   时间:2014-04-29 16:35:46    阅读次数:499
POJ 3356 AGTC(DP-最小编辑距离)
DescriptionLetxandybe two strings over some finite alphabetA. We would like to transformxintoyallowing only operations given below:Deletion:a letter i...
分类:其他好文   时间:2014-04-29 16:22:00    阅读次数:450
poj~题目分类
一.基本算法: (1)枚举. (poj1753,poj2965) (2)贪心(poj1328,poj2109,poj2586) (3)递归和分治法. (4)递推. (5)构造法.(poj3295) (6)模拟法.(poj1068,poj2632,poj1573,poj2993,poj2996)二.图...
分类:其他好文   时间:2014-04-29 11:27:47    阅读次数:489
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!