Need help with a game problem

Правка en3, от Kane, 2017-04-05 15:52:04

I'm trying to solve problem Game of Cards from SWERC-2015.

I guess, that this game is equivalent to Nim game. I calculated the Sprague-Grandy value from every pile of cards and counted xor of them.

Unfortunately, my solution gets WA on 7 test.

Please, help me with this problem.

Code

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Kane 2017-04-05 15:52:04 1 Tiny change: 'value frome every pil' -> 'value from every pil'
en2 Английский Kane 2017-04-05 14:26:36 15
en1 Английский Kane 2017-04-05 14:26:12 379 Initial revision for English translation
ru1 Русский Kane 2017-04-05 14:14:09 382 Первая редакция (опубликовано)