总时间限制: 1000ms 内存限制: 65536kB
描述
Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regrow. Thus, Farmer John has built a set of drainage ditches so that Bessie's clover patch is never covered in water. Instead, the water is drained to a nearby stream. Being an ace engineer, Farmer John has also installed regulators at the beginning of each ditch, so he can control at what rate water flows into that ditch. 
Farmer John knows not only how many gallons of water each ditch can transport per minute but also the exact layout of the ditches, which feed out of the pond and into each other and stream in a potentially complex network. 
Given all this information, determine the maximum rate at which water can be transported out of the pond and into the stream. For any given ditch, water flows in only one direction, but there might be a way that water can flow in a circle. 
输入
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.
样例输入
5 4
1 2 40
1 4 20
2 4 20
2 3 30
3 4 10
样例输出
50

I:trainage Ditches的更多相关文章

  1. POJ 1273 Drainage Ditches题解——S.B.S.

    Drainage Ditches Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 67823   Accepted: 2620 ...

  2. POJ1273Drainage Ditches[最大流]

    Drainage Ditches Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 71559   Accepted: 2784 ...

  3. poj1273 Drainage Ditches

    Drainage Ditches Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 68414   Accepted: 2648 ...

  4. POJ 1273 Drainage Ditches

    Drainage Ditches Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 67387   Accepted: 2603 ...

  5. HDU1532 Drainage Ditches 网络流EK算法

    Drainage Ditches Problem Description Every time it rains on Farmer John's fields, a pond forms over ...

  6. POJ-1273 Drainage Ditches 最大流Dinic

    Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 65146 Accepted: 25112 De ...

  7. POJ 1273 Drainage Ditches -dinic

    dinic版本 感觉dinic算法好帅,比Edmonds-Karp算法不知高到哪里去了 Description Every time it rains on Farmer John's fields, ...

  8. HD1532Drainage Ditches(最大流模板裸题 + 邻接表)

    Drainage Ditches Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) ...

  9. Drainage Ditches(dinic)

    Drainage Ditches Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 59210   Accepted: 2273 ...

随机推荐

  1. HTML初步入门

    标签元素 标签介绍 html元素包括一个或一对标签定义的包含范围.而标签就是由两个字符串"<"和">"号组成,标签包括开始标签"<& ...

  2. 5.对与表与表之间的关系,efcore是如何处理的

    public class Account { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Accoun ...

  3. 。i节点

    http://blog.csdn.net/feiyinzilgd/article/details/5609157  linux中,文件查找不是通过文件名称来查找的.实际上是通过i节点来实现文件的查找定 ...

  4. Linux进程管理

    一.进程管理简介 进程是正在执行的程序或命令,每一个进程都是一个运行实体,都有自己的地址空间,并占用一定的系统资源. 进程管理的作用: 1.判断服务器的健康状态 2.查看系统中的所有进程 3.杀死进程 ...

  5. Codeforces Round #385 (Div. 2) A,B,C 暴力,模拟,并查集

    A. Hongcow Learns the Cyclic Shift time limit per test 2 seconds memory limit per test 256 megabytes ...

  6. http协议 幂等性的理解

    HTTP GET.DELETE.PUT.POST四种主要方法的幂等性的理解 GET: GET请求是幂等的,多次的GET请求,不应该修改数据状态,只是查询. DELETE Delete请求也具有幂等性, ...

  7. (原创)提取Xilinx开发工具的迅雷下载地址

    ①进入Xilinx官网,进入Device->Design Tools,选择你想要下载的任意工具. ②进入新web页面,右方点击“Downloads”.③进入版本选择页面,选择想要的版本号,点击相 ...

  8. ArcGIS影像配准与空间配准

    ArcGIS影像配准与空间配准 ArcGIS影像配准与空间配准 地图配准可分为影像配准和空间配准.影像配准的对象是raster图,譬如TIFF图.配准后的图可以保存为ESRI GRID, TIFF,或 ...

  9. Dom 概览

    前言 我们已经接触并使用了很多api去操作html文档,例如:appendChild,getElementById, 等等.但是,每当我在浏览器输入document,window 按下回车,会发现还有 ...

  10. Oracle存储过程(转)

    Oracle存储过程基本语法 存储过程 1 CREATE OR REPLACE PROCEDURE 存储过程名 2 IS 3 BEGIN 4 NULL; 5 END; 行1: CREATE OR RE ...