The discussion of interesting tasks from the Czech national olympiad in informatics. We count the number of possible ways in a regular rectangular road network with some broken intersections.
The method of dynamic programming is used to solve the problem. The article shows how this method can be implemented in various ways and what consequences the chosen implementation has for the time complexity of the final solution.