Editorial for COCI '08 Contest 6 #5 Dostava
Submitting an official solution before solving the problem yourself is a bannable offence.
The traffic grid can be modeled with a graph consisting of
The all-pairs shortest paths problem can be easily solved by the Floyd-Warshall algorithm in
For full points, we can implement Dijkstra's algorithm or a dynamic programming solution that takes advantage of the special properties of the graph. First note that the shortest path between the endpoints of two rows
Comments