← All problemsSign in

Two Rolls

CodeChefRating 653Open on judge ↗

Chef is playing a board game, and is currently at position $X$. To win, he needs to reach position $50$. Chef has a pair of $6$-sided dice, which will decide how he moves - he will roll the pair of dice, sum up the numbers on them, and then move exactly that many steps forward. More precisely, if the dice show values of $d_1$ and $d_2$, Chef must move from $X$ to $(X+d_1+d_2)$. However, Chef

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