|
|
вернуться в форумWhat the algo? Послано romin 2 окт 2010 07:03 what the algo of this problem? please^_^ Re: What the algo? bottom-up DP, where DP[i] show will the first player win or lose the game with i rocks left, if everybody plays right and it's 1st player turn. Obviously, if i rocks left, and 1st player will lose, than i + k[j] is winning position for him (because if he throws away k[j] rocks, 2nd player will have i-th position, which is losing position for him an winning position for the first player). It's almost ready solution, just write a programm. Good luck! |
|
|