11054专题

(白书训练计划)UVa 11054 Wine trading in Gergovia(等价转换)

题目地址:UVa 11054 很巧妙的一道题,这题是利用的等价转换,对每一条路来说,假如右边生产的比左边的多x,那么不管起点是哪,终点是哪,都可以把左右两侧的看成两个点,要从这条路上运送x个劳动力。再由于总和是0,所以只需要算出一端的总和就可以,这样只要遍历一遍就可以算出来了。写出代码就很简单了。。。 代码如下: #include <iostream>#include <stdio.h

UVa 11054/HDU 1489/POJ 2940 Wine trading in Gergovia(贪心双向队列)

11054 - Wine trading in Gergovia Time limit: 3.000 seconds http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=113&page=show_problem&problem=1995 http://acm.hdu.edu.cn/s