← All problemsSign in

Roll & Jump

Chef is playing a stepping game alone, in which he has **N** blocks in front of him, and **M fair dice**. He is currently at the 0th block and wants to reach the **(N - 1)th** position, according to the outcomes of rolling the dice. He is moving forward as per the following rules: •If all the dice land on 6 after rolling simultaneously, Chef would jump 2 steps ahead. •If any of them does not r

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