P3063 [USACO12DEC] Milk Routing S
Description
Farmer John's farm has an outdated network of M pipes (1
Input Format
\* Line 1: Three space-separated integers: N M X (1
Output Format
\* Line 1: The minimum amount of time it will take FJ to send milk along a single path, rounded down to the nearest integer.
第1行:约翰沿着一条路径送牛奶花费的最少的时间,向下取整到最近的整数。
Explanation/Hint
FJ wants to send 15 units of milk through his pipe network. Pipe #1 connects junction point 1 (the barn) to junction point 2, and has a latency of 10 and a capacity of 3. Pipes #2 and #3 are similarly defined.
The path 1->3 takes 14 + 15/1 = 29 units of time. The path 1->2->3 takes 20 + 15/2 = 27.5 units of time, and is therefore optimal.
约翰想要通过管网运送15个单位的牛奶。管道1连接节点1(谷仓)和节点2,延迟为10,容量为3。管道2和管道3也以相似的方式来定义。
路径1->3花费14+15/1=29个单位的时间。路径1->2->3花费20+15/2=27.5个单位的时间,用时最少。