mdtareque's blog

By mdtareque, history, 8 years ago, In English

Can anyone help with explaining the sample test case for 'Stones Game' on A2Oj, Ladder 2, problem no. 5, problemId = 8

https://a2oj.com/p?ID=8

It says, m player, n stones and need to find whether player with index idx has a optimal strategy to win the game or not? Yes/No answer to be given.

But, if we look at example 1

   2 2 2

Here, players=2, stones = 2 and Answer to find for player index =2. Let's call players by name A and B, so we have following scenarios

   A | B | A | B
   0   1              ->> B wins
   1   1              ->> B wins
   2   0              ->> A WINS

The answer to this test case given on a2oj is YES, but clearly we can see that B can't win in 3rd case. Am I missing something here? Can anyone please help me out?

Thanks,

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

You can't take 2 stones on the first move of the game. Make sure you understand the rules (they're phrased quite badly) — read step 2 of the game a few more times