← All problemsSign in

Sherlock and Prince of Persia

Sherlock is playing Prince of Persia where there are N levels. Each level requires certain amount of time to finish. Every level is also characterised by two other parameters XP_needed and XP_gain. The time units need to finish, minimum experience needed and experience gain of the i-th level is given by T[ i ] , XP_needed[ i ] and XP_gain[ i ], respectively. Sherlock can play the i-th level if his

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