
贪心算法
lyhvoyage
不抛弃,不放弃!
展开
-
hdu 1051 Wooden Sticks
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Problem DescriptionThere原创 2013-04-04 10:24:45 · 957 阅读 · 0 评论 -
CodeForces 416C Booking System(贪心)
Booking SystemTime Limit:1000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionInnovation technologies are on a victorious march around the planet. They inte原创 2014-04-15 23:10:11 · 1838 阅读 · 0 评论 -
NYOJ 914 Yougth的最大化(二分搜索 + 贪心)
Yougth的最大化时间限制:1000 ms | 内存限制:65535 KB难度:4描述Yougth现在有n个物品的重量和价值分别是Wi和Vi,你能帮他从中选出k个物品使得单位重量的价值最大吗?输入有多组测试数据每组测试数据第一行有两个数n和k,接下来一行有n个数Wi和Vi。(1输出输出使得单位价值的最大值。(保留两位小数)样原创 2014-04-09 09:34:13 · 2568 阅读 · 1 评论 -
NYOJ 47 过河问题 (贪心)
过河问题时间限制:1000 ms | 内存限制:65535 KB难度:5描述在漆黑的夜里,N位旅行者来到了一座狭窄而且没有护栏的桥边。如果不借助手电筒的话,大家是无论如何也不敢过桥去的。不幸的是,N个人一共只带了一只手电筒,而桥窄得只够让两个人同时过。如果各自单独过桥的话,N人所需要的时间已知;而如果两人同时过桥,所需要的时间就是走得比较慢的那个人单独行原创 2014-04-08 17:38:51 · 6144 阅读 · 2 评论 -
NYOJ 680 摘枇杷(二分搜索+贪心)
摘枇杷时间限制:2000 ms | 内存限制:65535 KB难度:3描述理工学院的枇杷快熟了,ok,大家都懂得。而且大家都知道,学校的枇杷树都是一列一列的。现在小Y同学已经在筹划怎么摘枇杷了。现在我们假设有一列枇杷树,而且每棵枇杷树上枇杷果的数量小Y都已经知道了。假设现在有n棵枇杷树,小Y可以把这n棵枇杷树分成m组,每组枇杷果的数量是这组内每棵原创 2014-04-09 13:30:24 · 1540 阅读 · 0 评论 -
NYOJ 586 疯牛 & POJ 2456(二分搜索 + 贪心)
疯牛时间限制:1000 ms | 内存限制:65535 KB难度:4描述农夫 John 建造了一座很长的畜栏,它包括N (2 但是,John的C (2 输入有多组测试数据,以EOF结束。第一行:空格分隔的两个整数N和C第二行——第N+1行:分别指出了xi的位置输出每组测试数据输出一个整数,满足题意的最大的最小值,注意换行。样例输入原创 2014-04-09 13:19:12 · 5637 阅读 · 9 评论 -
NYOJ 30 Gone Fishing(贪心)
Gone Fishing时间限制:3000 ms | 内存限制:65535 KB难度:5描述John is going on a fishing trip. He has h hours available (1 <= h <= 16), and there are n lakes in the area (2 <= n <= 25) all reachable原创 2014-04-09 19:18:04 · 4576 阅读 · 0 评论 -
NYOJ 248 BUYING FEED (贪心)
描述Farmer John needs to travel to town to pick up K (1 The county feed lot has N (1 <= N<= 100) stores (conveniently numbered 1..N) that sell feed. Each store is located on a segment of the X a原创 2014-04-11 08:18:19 · 2067 阅读 · 0 评论 -
hdu 1050 Moving Tables
Moving TablesTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionThe famous AC原创 2013-04-03 21:34:11 · 1147 阅读 · 0 评论 -
UVA 10026 Shoemaker's Problem
Shoemaker's ProblemShoemaker has N jobs (orders from customers) which he must make. Shoemaker can work on only one job in each day. For each ith job, it is known the integer Ti (1i<=1000原创 2014-07-15 15:41:41 · 1360 阅读 · 0 评论 -
hdu 3183 A Magic Lamp(RMQ)
A Magic Lamp Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Problem Descripti原创 2014-08-05 09:39:10 · 3658 阅读 · 1 评论 -
CodeForce 463C Gargari and Bishops(贪心+暴力)
Gargari and Bishopstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGargari is jealous that his friend Cais原创 2014-09-01 20:44:55 · 1719 阅读 · 0 评论 -
CodeForce 3B Lorry(贪心)
B. Lorrytime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputA group of tourists is going to kayak and catamaran原创 2014-10-16 20:16:06 · 2421 阅读 · 0 评论 -
ZOJ 1409 Communication System(枚举 + 贪心)
Communication SystemTime Limit: 10 Seconds Memory Limit: 32768 KBWe have received an order from Pizoor Communications Inc. for a special communication system. The system consists of sever原创 2014-04-15 08:47:45 · 1974 阅读 · 0 评论 -
hdu 1800 Flying to the Mars
Flying to the MarsTime Limit : 5000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem DescriptionIn t原创 2013-04-03 10:03:12 · 917 阅读 · 0 评论 -
NYOJ 179 LK's problem
LK's problem时间限制:3000 ms | 内存限制:65535 KB难度:1描述LK has a question.Coule you help her?It is the beginning of the day at a bank, and a crowd of clients is already waiting for the entran原创 2013-05-26 17:44:18 · 1391 阅读 · 0 评论 -
NYOJ 287 Radar 贪心之 区间选点
Radar时间限制:1000 ms | 内存限制:65535 KB难度:3描述Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in原创 2013-04-15 09:47:20 · 1133 阅读 · 0 评论 -
NYOJ 14 会场安排问题 贪心算法 之 选择不相交区间
会场安排问题时间限制:3000 ms | 内存限制:65535 KB难度:4描述学校的小礼堂每天都会有许多活动,有时间这些活动的计划时间会发生冲突,需要选择出一些活动进行举办。小刘的工作就是安排学校小礼堂的活动,每个时间最多安排一个活动。现在小刘有一些活动计划的时间表,他想尽可能的安排更多的活动,请问他该如何安排。输入第一行是一个整型数m(m每组测试原创 2013-01-20 16:25:07 · 2270 阅读 · 0 评论 -
NYOJ 71 独木舟上的旅行 贪心算法 之 乘船问题
独木舟上的旅行时间限制:3000 ms | 内存限制:65535 KB难度:2 描述 进行一次独木舟的旅行活动,独木舟可以在港口租到,并且之间没有区别。一条独木舟最多只能乘坐两个人,且乘客的总重量不能超过独木舟的最大承载量。我们要尽量减少这次活动中的花销,所以要找出可以安置所有旅客的最少的独木舟条数。现在请写一个程序,读入独木舟的最大承载量、旅客数目和每位旅客的重量。根原创 2013-01-20 11:12:39 · 6222 阅读 · 0 评论 -
hdu 1009 FatMouse'Trade 贪心算法 之 部分背包问题
FatMouse' Trade Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 14 Accepted Submission(s) : 3Problem DescriptionFatMouse prepared M poun原创 2013-01-19 17:22:35 · 1493 阅读 · 0 评论 -
NYOJ 6 喷水装置(一) 贪心算法 之 区间覆盖问题
喷水装置(一)时间限制:3000 ms | 内存限制:65535 KB难度:3描述现有一块草坪,长为20米,宽为2米,要在横中心线上放置半径为Ri的喷水装置,每个喷水装置的效果都会让以它为中心的半径为实数Ri(0输入第一行m表示有m组测试数据每一组测试数据的第一行有一个整数数n,n表示共有n个喷水装置,随后的一行,有n个实数ri,ri表示该喷水装置能覆盖的圆的半径。原创 2013-01-20 10:12:40 · 2228 阅读 · 0 评论 -
UVA 10465 - Homer Simpson 贪心
Homer SimpsonTime Limit: 3 secondsMemory Limit: 32 MBHomer Simpson, a very smart guy, likes eating Krusty-burgers. It takes Homer m minutes to eat a Krusty- burger. However原创 2013-08-02 18:29:27 · 1817 阅读 · 0 评论 -
POJ 2431 Expedition (贪心 + 优先队列)
ExpeditionTime Limit: 1000MS Memory Limit: 65536K DescriptionA group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather po原创 2014-03-01 10:02:43 · 4544 阅读 · 2 评论 -
hdu 1789 Doing Homework again 贪心算法
Doing Homework againTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem DescriptionIgnatius has just come back school from the 30th ACM/ICPC. No原创 2013-01-22 08:26:12 · 4080 阅读 · 2 评论 -
hdu 1052 Tian Ji -- The Horse Racing
Tian Ji -- The Horse RacingTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description原创 2013-04-04 10:10:55 · 1147 阅读 · 0 评论 -
hdu 2570 迷障(贪心)
迷瘴Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/OtherFont: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description通过悬崖的yifenfei,又面临着幽谷的考验——原创 2013-04-02 18:34:46 · 1522 阅读 · 0 评论 -
CodeForce 538C Tourist's Notes(贪心 + 数学)
C. Tourist's Notestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA tourist hiked along the mountain ran原创 2015-05-01 14:44:05 · 2461 阅读 · 0 评论