Chef’s Adventure
CodeChefOpen on judge ↗
Chef is on an adventure trip. Chef is going to climb a mountain and he can perform $N$ operations in any order and any number of times he wants **(possibly zero)**. A list of $N$ integers represent the operations. In each operation, Chef can climb or slip $A_i (1 \leq i \leq N)$ metres according to his choice. There is a cave at height $H$ metres. Since Chef is already tired due to his previous
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.
Sign in to chat with the tutor and save your progress.
Sign in to start