Page 1 of 1

3337 - Random walk

Posted: Fri Sep 05, 2008 5:37 am
by andmej
Hi, I don't have a clue on how to solve this problem from the Live Archive: 3337 - Random walk. I tried a greedy solution but this gave me wrong answer.

I can smell dynamic programming in this problem, but the state I've thought about is too big and will surely exceed the memory (and time) limit.

Can anyone help me solve this one?