hackerrank[Vertical Rooks]

Revision en1, by saba_tavdgiridze, 2016-02-14 18:40:43

Today I've solved this problem Vertical Rooks . This is Nim , but you can also add some stones , in editorial it's written that that's no difference because if someone adds some stones , you can by the way reduce the heap by the same number of stones . (That's intuitive : every time opponent adds some stones , I can decrease the number and It will be the same state . At some time he will be bored and I will win with optimal play . ) But I think it isn't correct . [my solution] in spite of we can add some stones to the heap . Grundy number of one heap will be same g(x) = x , so it's also nim.Is is correct?

Tags nim, game theory


  Rev. Lang. By When Δ Comment
en1 English saba_tavdgiridze 2016-02-14 18:40:43 694 Initial revision (published)