Game
CodeChefOpen on judge ↗
Alice and Bob are playing a game. They have 3 bags, each consisting a certain number of balls. Alice starts the game by picking a ball from any one of the bag.Then Bob picks a ball from one of the other 2 bags. That is, in their turn they have to pick a ball from any of the bags, except the bag from which the other player picked up in their last turn. The player who cannot make a move loses. Given
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