Background of the question.
It takes 3+(2-1)+(2-1)=5 minutes to pass through the K-A-I-H
route.
The fast path K-B-H is 2+(5-1)=6 minutes due to the complicated
intersection B in the middle.
It takes. However, the order of the start and end vertices in
this path is not included in the time calculation. You have to find
and print the longest distance, that is, the shortcut, among urban
road networks in view of the shortest route calculated in this
way
Input/Output
The first line of the input file is given the number of vertices
N (5<=N<=75). And on each of the following lines, the
neighborhood vertices connected to each vertex v(i) are all given
numbers from 1 to N, and the end is denoted by the number 0. The
output of the graph is diameter D, max {short(x,y)}Outputs
something as an integer. However, there must be a path between all
two points in the input graph.
C++ programming help me!
А I K B H E F с G D
입력 stdin 출력 stdout 12 10 // N=10 1 4 6 8 10 0 2 3 910 0 3 2 10 0 4 1 9 0 5 7 9 0 6 1 0 7 5 90 8 1 10 0 9 2 4 5 7 10 0 10 1 2 3 8 9 0 - 10 8
Background of the question. It takes 3+(2-1)+(2-1)=5 minutes to pass through the K-A-I-H route. The fast path K-B-H is 2
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am