Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Another easy one solved by Sprague-Grundy theorem.

Each pile is a sub-game, so you need to XOR SG value of all substates - since you can move # of 1 - #(pile), so the SG value is the #(pile) itself.

Also, please handle the special case of 1,1,1,1....

posted on 2017-12-27 11:37  Tonix  阅读(141)  评论(0编辑  收藏  举报