Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:谢谢wtommy,已经ac了。In Reply To:Re:恳请赐教:用贪心法时,已找到最大的fi,若其对应di为0,之后就可以一直在第i条河中钓鱼直到结束,这样没错吧? Posted by:wtommy at 2006-03-19 09:49:57 > 首先你可以枚举John需要走过的湖泊数X,即假设他从1号湖泊最远走到了X号湖泊,所以他路上花去时间为T= SUM(1..X-1)。在这个前提下,我们可以认为John在任意一个时刻都可以从1到X湖泊中任选一个钓一次鱼。可以采取贪心策略,每次都找鱼最多的湖泊去钓鱼。这样就会得到最优解。 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator