Sort 6 Discussions, By:
Please Login in order to post a comment
In test case 1, how are the last two "IXIXIII" and "XIIIXIXXIX" wins? And are there different test cases for different languages?
Winning moves for these cases:
IXIXIII -> IXIXIXI
XIIIXIXXIX -> XIXIXIXXIX
does dynamic programming work.
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] \\)
What does it mean if both player play optimally?
At the respective chance, they will choose the best step.
can someone give me full code for this project?
can i code it in C language
Hi, since this is a functional programming track only those languages which have extensive support to this paradigm is allowed.
Probably you are looking for algorithm track.
but is it possible that we can solve it using c/c++, python
As they are turing complete languages, yes.
No more comments