|
|
back to boardCommon BoardCan someone give me an idea to solve 1119??? First of all sorry for my bad english. I only think in solve this problem by sorting the points in a way I can check from the most east-south point to the most north-west point, but for every point I must check all posibilities, I mean, for every point I choose to cross the diagonal I have to check all the posibilities of doing with the other points because the fact that the point is on the most east or most south position isn't enough reason to use it, so it will give me a really slow algorithm.. I am really stuck with this problem, if someone can help me I would appreciate a lot... I also note that there are some other problems that you can solve in the same way of solve this thanks a lot! Re: Can someone give me an idea to solve 1119??? Dynamic programming Re: Can someone give me an idea to solve 1119??? and some other clue to know how to use dynamic programming in this problem?? Re: Can someone give me an idea to solve 1119??? Assume Row[0..1,0..max]of real is best answer for previous row (Row[0]) and for current row (Row[1]). Init:Row[0,i]=i. Then in each iteration of cycle you find shortest path: try to move left(or right),then up and, if it exist, to diagonal. After all you must mark current row as previous. |
|
|