A friends game
CodeChefOpen on judge ↗
Ross and Rachel are playing a game. They have a tree rooted at 1. Each vertex is having some number of stones in it. In one move a player can choose 2 stones from some same node and move it to any of the ancestors of that node in the tree. The player not able to make a move loses. Help them find the winner of the game if they play optimally. Rachel starts first. Input First line will conta
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