Graph Theory37 sections · 1633 units
Open in Course

CSES 1673 High Score - Problem Statement

(CSES 1673)

You have nn rooms and mm tunnels with score values. You start at room 11 and want to reach room nn with maximum total score. Some tunnels have negative scores. If you can loop through rooms infinitely to increase score, output 1-1. Otherwise, output the maximum score you can achieve on any path from room 11 to room nn.

This is a shortest path problem disguised as a maximum path problem. The twist is that you are maximizing score instead of minimizing cost, and you need to detect if infinite score is possible.