10610 - Gopher and Hawks
Solution Description : BFS problem This is just a BFS problem with a bit of math. 1. Find all adjacency using this condition, consider two holes connected if the distance between them is less than or equal to v*m*60. 2. Run BFS on the gopher holes to destination hole. 3. If gopher reach to destination hole then print length of shortest path -1. 4. Otherwise print No. |
||||||||||