← All problemsSign in

2 - Reach a level

You are playing a computer game. This game has $n$ levels numbered with the integers from $1$ to $n$. At any point in time, you are located at one of the levels with some **penalty**, represented by a non-negative real number. Initially, you start at level $1$ with penalty $0$. There are $m$ options to change levels. Each option is described by pair of levels $s$, $f$ (possibly equal) and penalty

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start