I'm totally new to game theory. I think this problem 847 — A Multiplication Game can be solved using minimax algorithm. But I can't design the losing position for this problem. This problem may solve by finding pattern CF post, but I want to solve this problem with the concept of game theory (minimax algorithm). Any hint(how to think about losing position) for this problem form u, programmers??? :)
I think we can solve it using Dp . Key point is there will be around O(sqrt(n)) states.So we can solve it using dp with recursion trying to label these sqrt(n) states as P and N positions.
PS: looks fine. But havent implemented.