← All problemsSign in

The Last Sweet Game

Alice and Bob have just bought a total of n sweets from the sweet shop , and are going to eat them . Now , since both Alice and Bob are very kind ,they both want the other person to eat the last sweet. So , Alice and Bob decide to play a game. On each person's turn, they will eat k sweets such that k is a square number ( and $1 \leq k \leq$ number of leftover sweets ) . Given that Alice starts th

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