aloo08051999's blog

By aloo08051999, history, 3 years ago, In English

Problem is- given two piles of stones having a,b stones respectively(a,b <200000). in each move one player takes out 3*x stones from one and add x to other. Both player play optimally.Player who cant make a move loses. Who wins ?

This is problem from newton coding challenge i am unable to come up with any optimised approach/expression.I was thinking to find intermediate states and find if any is forcefully losing for player 2 then player 1 wins but constraint are high.Please help by providing some hints on how to solve similar pattern problem.

Full text and comments »

  • Vote: I like it
  • -1
  • Vote: I do not like it