Developer shares C++ solution to CSES shortest-path task counting routes and flights
A DEV Community post presents a C++ program for a CSES problem set task about flight routes. The code uses Dijkstra's algorithm with a priority queue to compute the shortest distance from city 1 to city n. It also counts the number of shortest paths modulo 1e9+7 and tracks the minimum and maximum number of flights among those shortest routes. The author posts the code with a link to the original CSES task for readers to study the approach.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in