The input includes several cases. For each case, the first line contains two space-separated integers, N (0 <= N <= 200) and M (2 <= M <= 200). N is the number of ditches that Farmer John has
dug. M is the number of intersections points for those ditches. Intersection 1 is the pond. Intersection point M is the stream. Each of the following N lines contains three integers, Si, Ei, and Ci. Si and Ei (1 <= Si, Ei <= M) designate the intersections
between which this ditch flows. Water will flow through this ditch from Si to Ei. Ci (0 <= Ci <= 10,000,000) is the maximum rate at which water will flow through the ditch.
For each case, output a single integer, the maximum rate at which water may emptied from the pond.
Sample Output5 4 1 2 40 1 4 20 2 4 20 2 3 30 3 4 10
50
题意:n个点,m条单向边,求1到n的最大流。
分析:是一道网络流的基础入门题,也是道模板题。
#include#include #include #include #include #include