Array Game
CodeChefOpen on judge ↗
Problem description. 2 players A and B are playing a game taking turns alternatively.They are given an array of 'N' numbers : X[1],X[2].....X[N] .. During each turn , the player selects an index 'i' 0 , subtracts 1 from X[i] and adds 1 to either X[2*i],X[3*i] or X[5*i] ( Obviously the index to which the player is adding should be less than or equal to N ) . Player A starts the game and makes the
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