P3011 [USACO11JAN] Traffic Lights S

Background

征求翻译。如果你能提供翻译或者题意简述,请直接发讨论,感谢你的贡献。

Description

Kenosha, the city nearest Farmer John, has M (1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>4 ```

Input Format

\* Line 1: Two space-separated integers: S and D \* Line 2: Two space-separated integers: N and M \* Lines 3..N+2: Line i+2 line describes junction i with a character and three integers (all separated by a single space): C\_i, R\_i, DB\_i, and DP\_i \* Lines N+3..N+M+2: Line N+2+k describes road k with three integers: i, j, and T\_ij

Output Format

\* Line 1: One integer: the time taken by a minimum-time path from the source junction to the destination junction. If there is no path, output 0.