← All problemsSign in

Dice Game 3

CodeChefRating 889Open on judge ↗

Chef is playing a game consisting of $N$ rounds. In each round he rolls a regular six faced dice. He starts with an initial score of $0$. Let the number rolled by him in a particular round be $X$. If this is not the first round and the previous number rolled was $1$, Chef will add $2 \cdot X$ to his score, otherwise he will add $X$ to his score. For example, if the game has $6$ rounds and the

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