HDU 5935 Car【贪心,枚举,精度】】的更多相关文章

Hdu 4864(Task 贪心) 原题链接 题意:给定n台机器和m个任务,任务和机器都有工作时间值和工作等级值,一个机器只能执行一个任务,且执行任务的条件位机器的两个值都大于等于任务的值,每完成一个任务可获奖励500x+2y.求完成最多任务前提下可获得最高奖励,输出任务数和奖励数. 解法:对机器和任务进行排序,x和y都从大到小排.循环考察每一个任务,把满足每一个任务x值的机器等级都记录下来,然后用满足任务等级的最小等级机器完成此任务.这样的做法可以保证: 前面的任务执行比后面的任务可获的奖励更…
看题传送门:http://poj.org/problem?id=1018 题目大意: 某公司要建立一套通信系统,该通信系统需要n种设备,而每种设备分别可以有m个厂家提供生产,而每个厂家生产的同种设备都会存在两个方面的差别:带宽bandwidths 和 价格prices. 现在每种设备都各需要1个,考虑到性价比问题,要求所挑选出来的n件设备,要使得B/P最大. 其中B为这n件设备的带宽的最小值,P为这n件设备的总价. 思路: 贪心+枚举 要使得B/P最大,则B应该尽量大,而P尽量小. 可以按照价格…
D - 淡黄的长裙 HDU - 4221(贪心) James is almost mad! Currently, he was assigned a lot of works to do, so many that you can't imagine. Each task costs Ai time as least, and the worst news is, he must do this work no later than time Bi! OMG, how could it be c…
Problem Description Ruins is driving a car to participating in a programming contest. As on a very tight schedule, he will drive the car without any slow down, so the speed of the car is non-decrease real number. Of course, his speeding caught the at…
Delicious Apples Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 199    Accepted Submission(s): 54 Problem Description There are n apple trees planted along a cyclic road, which is L metres l…
转自:http://blog.csdn.net/a601025382s/article/details/12308193 题意: 输入背包体积n,绿宝石体积s1,价值v1,蓝宝石体积s2,价值v2,宝石数目无限,问背包里能放下的最大价值? 题解: 看过去很像完全背包,可数据很大(虽然没给出,也能猜到,不然太水了),所以不能用背包求.又只有两种物品,想到了贪心,将价值与体积比大(称为价值比)的优先放入.但体积限制,这样还不可以,还需要枚举减少价值比大的宝石个数,是否可以增大所求价值.又我们可以知道…
Delicious Apples Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 395    Accepted Submission(s): 122 Problem Description There are n apple trees planted along a cyclic road, which is L metres…
Delicious Apples Time Limit: 5000/3000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 321    Accepted Submission(s): 95 Problem Description There are  apple trees planted along a cyclic road, which is  metres lon…
Average Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2069    Accepted Submission(s): 517Special Judge Problem Description There are n soda sitting around a round table. soda are numbered fr…
555555,能避开精度还是避开精度吧,,,,我们是弱菜.. Poor Warehouse Keeper Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1672    Accepted Submission(s): 463 Problem Description Jenny is a warehouse keeper. He writ…