poj 2431 Expedition(优先队列+贪心)(北邮新生赛2016H)

博客介绍了如何运用优先队列和贪心策略解决poj 2431 Expedition问题。该问题涉及一辆车从起点出发,途经多个加油站,需要确定最少加油次数以到达终点。由于01背包和图论方法不适合,作者提出按加油站距离排序,利用贪心策略选取能到达的加油站中油量最多的进行加油,直至油量足以抵达终点。此方法适用于nlogn级别的数据规模。
摘要由CSDN通过智能技术生成

Time Limit: 1000MS   Memory Limit: 65536K
Total Submissions: 10700   Accepted: 3117

Description

A group of cows grabbed a truck and ventured on an expedition deep into the jungle. Being rather poor drivers, the cows unfortunately managed to run over a rock and puncture the truck's fuel tank. The truck now leaks one unit of fuel every unit of distance it travels. 

To repair the truck, the cows need to drive to the nearest town (no more than 1,000,000 units distant) down a long, winding road. On this
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值