mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-30 00:37:37 +08:00
36 lines
2.0 KiB
HTML
36 lines
2.0 KiB
HTML
<!DOCTYPE html>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
<h1>1003. Universal Travel Sites (35)</h1>
|
|
<div id="problemContent">
|
|
<p>After finishing her tour around the Earth, CYLL is now planning a universal travel sites development project. After a careful investigation, she has a list of capacities of all the satellite transportation stations in hand. To estimate a budget, she must know the minimum capacity that a planet station must have to guarantee that every space vessel can dock and download its passengers on arrival.</p>
|
|
<p><b>Input Specification:</b></p>
|
|
<p>Each input file contains one test case. For each case, the first line contains the names of the source and the destination planets, and a positive integer N (<=500). Then N lines follow, each in the format: </p>
|
|
<p>
|
|
source<sub>i</sub> destination<sub>i</sub> capacity<sub>i</sub>
|
|
</p>
|
|
<p>
|
|
where source<sub>i</sub> and destination<sub>i</sub> are the names of the satellites and the two involved planets, and capacity<sub>i</sub> > 0 is the maximum number of passengers that can be transported at one pass from source<sub>i</sub> to destination<sub>i</sub>. Each name is a string of 3 uppercase characters chosen from {A-Z}, e.g., ZJU.</p>
|
|
<p>
|
|
Note that the satellite transportation stations have no accommodation facilities for the passengers. Therefore none of the passengers can stay. Such a station will not allow arrivals of space vessels that contain more than its own capacity. It is guaranteed that the list contains neither the routes to the source planet nor that from the destination planet.
|
|
</p>
|
|
<p><b>Output Specification:</b></p>
|
|
<p>For each test case, just print in one line the minimum capacity that a planet station must have to guarantee that every space vessel can dock and download its passengers on arrival.
|
|
</p>
|
|
<b>Sample Input:</b><pre>
|
|
EAR MAR 11
|
|
EAR AAA 300
|
|
EAR BBB 400
|
|
AAA BBB 100
|
|
AAA CCC 400
|
|
AAA MAR 300
|
|
BBB DDD 400
|
|
AAA DDD 400
|
|
DDD AAA 100
|
|
CCC MAR 400
|
|
DDD CCC 200
|
|
DDD MAR 300
|
|
</pre>
|
|
<b>Sample Output:</b><pre>
|
|
700
|
|
</pre>
|
|
</div> |