Buddy NIM
CodeChefOpen on judge ↗
Alice, Bob and Charlie are playing a new game called Buddy NIM. The game is played at two tables; on the first table, there are $N$ heaps containing $A_1, A_2, \ldots, A_N$ stones and on the second table, there are $M$ heaps containing $B_1, B_2, \ldots, B_M$ stones respectively. Initially, Alice is playing at the first table and Bob is playing at the second table. The players take their turns in
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