Introduction - If you have any usage issues, please Google them yourself
Use the shortest path algorithm to calculate the distance between two specific two points
Input: read the net.in file directly
The first behavior is four integers N, M, S and T. Every two integers are separated by a space, representing the node of the network (number 1 to N), the number of network segments, and the origin and destination number.
Next, M row, each row three integers U, V, D, each integer is separated by spaces, indicating that there is a line between nodes U and V, the distance is D, (there may be multiple lines in two nodes).
Output: write directly to net.out file, output only one line, which indicates the shortest distance from S point to T point (if it doesn't connect, output -1) (N<=100, M<=N*N, D<=1000).
Floyd-Warshall algorithm