We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I don't think this task is set up correctly. The problem states that both players play "optimally", but how the definite looser could play optimally? Optimal behaviour of definite looser is to make the game as long as possible (to reach to Apocalypse:)). The distances between board bounds and rook positions are not taken into account in reference implementation, and the looser (imagine it is the player who moves first, 2nd) may move his rook backwards (even if forward moves are possible) and change whole XOR-ing result finally.
Also, it looks like the comparison to NIM is incorrect, because in NIM you cannot put an item back (i.e., move backwards in VRooks).
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Vertical Rooks
You are viewing a single comment's thread. Return to all comments →
I don't think this task is set up correctly. The problem states that both players play "optimally", but how the definite looser could play optimally? Optimal behaviour of definite looser is to make the game as long as possible (to reach to Apocalypse:)). The distances between board bounds and rook positions are not taken into account in reference implementation, and the looser (imagine it is the player who moves first, 2nd) may move his rook backwards (even if forward moves are possible) and change whole XOR-ing result finally.
Also, it looks like the comparison to NIM is incorrect, because in NIM you cannot put an item back (i.e., move backwards in VRooks).