← All problemsSign in

Jump mission

CodeChefRating 2859Open on judge ↗

Chef the chief is participating in a hill jumping competition. There are N hills arranged in a row, and each of them is assigned a unique index from 1 to N — the ith hill has an index Pi on it. The height of the ith hill is Hi. Chef starts at the first hill with a goal to reach the Nth hill by jumping over hills from left to right (he is not allowed to jump in the other direction), jumping from

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