Game of Stones
CodeChefOpen on judge ↗
Sam and Zuck are playing a game. In this game there are k piles, numbered from 1 to n. Each pile, for i from 1 to n, has ni number of stones. In his turn, a player can select any odd number of piles having at least one stone, and remove one stone each from all these piles. Since Zuck already is the owner of a multi-billion dollar company, he allows Sam to take the first turn in this game. The play
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