Question: 1 4 5 1 9 - DS _ 2 0 2 4 _ HW 4 _ Graph Use C + + Description Kirito's school has
DSHWGraph Use C
Description
Kirito's school has strict rules: he is required to arrive before : AM every day. However, Kirito has a bad habit of oversleeping. To avoid being late, Kirito bought a spacerunning device that allows him to travel at a speed of kilometers per second, where k is any natural number.
Of course, the distance Kirito can travel is limited by the storage size of an int, meaning the total travel distance cannot exceed the maximum value of an int in kilometers
The route from Kirito's home to the school can be represented as a directed graph, with his home being node and the school being node n Each edge represents a distance of kilometer.
Kirito wants to wake up as late as possible, so you need to help him determine the minimum number of seconds it will take him to reach the school. It is guaranteed that there is at least one path from node to node n
Graph from Sample Input
Input
The first line contains two integers, and where representing the number of nodes and edges.
The next lines each contain two integers and indicating a directed edge from node to node
Output
Output a single number representing the minimum number of seconds it will take to reach the school.
Sample Input
Sample Output
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
