Graph Theory37 sections · 1633 units
Open in Course

CSES 1202 Investigation - Problem Statement

(CSES - Dijkstra + counting)

You have a directed graph with N cities and M flights. Find these four values for paths starting at city 11 and ending at city N:

1.1. Shortest distance.

2.2. Number of shortest paths (mod 109+710^9 + 7).

3.3. Minimum flights on a shortest path.

4.4. Maximum flights on a shortest path. Constraints: N105N \leq 10^5, M ≤ 2×1052 \times 10^5. All four answers come from a single modified Dijkstra run where you maintain extra arrays alongside the distance array.