Sunday, November 23, 2014

SPOJ 5676. STONE GAME (RESN04)

Thing we have to notice here is that the game can't have different outcomes if played different way. Consider the pile i , which has A[i] elements, how many times a move can took place for pile i, as long as there are full i-s in A[i] which means A[i]/i times, we can calculate the total number of moves possible for all the piles and in the end if it is an odd number then Alice will win.


       FULL SOURCE CODE

No comments:

Post a Comment