#P2299. Mzc和体委的争夺战
Mzc和体委的争夺战
Description
mzc is very rich (just kidding). He has male servants (those who did the first three installments know this). But such a large number of male servants attracted our PE monitor (a short, chubby fellow), who wants to compete with mzc for them.
mzc is very angry and decides to duel him, but cat's stamina is indeed somewhat unstable, so he needs you to help him calculate the minimum required time.
Input Format
The first line contains two numbers . means there are stops, and means there are roads.
Then follow lines, each with three numbers , meaning that it takes time to go from stop to stop . Note that the edges are bidirectional. That is, it also takes time to go from stop to stop .
Output Format
Output one line: the shortest time from to .
5 8
1 2 3
2 3 4
3 4 5
4 5 6
1 3 4
2 4 7
2 5 8
1 5 100
11
Hint
Constraints: , , .
Time limit: s.
Translated by ChatGPT 5
京公网安备 11011102002149号