Sort 12 Discussions, By:
Please Login in order to post a comment
The title should read "... Kayles". OEIS A002186 Sprague-Grundy values for the game of Kayles (octal games .77 and .771).
kayles = (==0) . foldl1 xor . map (grundy!!)
grundy = map g [0..]
g 0 = 0
g n = mex n [grundy!!l `xor` grundy!!r | m<-[n-1,n-2],l<-[0..m`div`2],let r=m-l]
mex n = minimum . ([1..n] \\)
does dynamic programming work.
In test case 1, how are the last two "IXIXIII" and "XIIIXIXXIX" wins? And are there different test cases for different languages?
What does it mean if both player play optimally?
Coming up with your hot favorite article about download free music from hacked Spotify. Similarly, In this tutorial i’m gonna show you to get free music in how to get spotify premium