768E — Games of stones (Grundy)

Правка en1, от yelghareeb, 2018-01-07 23:45:48

In problem 768E - Game of Stones, there are n piles, each with s stones (1 <= s <= 60). Players alternate moving as in the ordinary Nim with 1 restriction: no move can be made more than once on a pile (e.g. cannot remove 4 stones from pile 1, if 4 stones were previously removed from it).

The intended solution is to use dynamic programming with bitmasks to calculate the Grundy value for each pile size, state = (number of stones, mask), where mask represents the available moves.

However, I coded a simpler solution and got AC. The problem turned to be equivalent to taking a larger amount of stones at each step (Submission: 33990154). I don't fully understand this equivalence, and whether it's correct or not. Can anyone shed light on a formal proof for this?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский yelghareeb 2018-01-07 23:45:48 849 Initial revision (published)