ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1087. The Time to Take Stones

What the algo?
Posted by romin 2 Oct 2010 07:03
what the algo of this problem? please^_^
Re: What the algo?
Posted by Vedernikoff Sergey (HSE: АОП) 2 Oct 2010 14:11
DP
Re: What the algo?
Posted by PrankMaN 24 Mar 2013 02:43
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!