Answers to: INOI 2010 Twin Robotshttps://inoi15.discuss.codechef.com/questions/63361/inoi-2010-twin-robots<p>Hi people,
During the current INOI practice contest, i saw that INOI 2010 question 2 has been asked. Can someone help me formulate a Dp solution for it. I don't wish to cheat, rather I wish to learn how to solve a graph + DP type problem. The contest ends at 10:00 pm, and by then it'll be too late to learn anything new, so I request help right now and also request others not to cheat during the 'practice ' contest using any solutions below...</p>
<p>This is my current DP formulation, yet I believe the following recurrence relation might just go on and my base case(s) are incorrect. Yet, here goes:</p>
<pre><code>sum(i, j, k, l) = grid[i][j] + grid[k][l] + max(sum(i-1, j, k, l-1),sum(i, j-1, k-1, l))
if(i > 0 & l > 0) if(j > 0 & k > 0)
sum(0, 0, 0, n-1) = grid[0][0] + grid[0][n-1]
</code></pre>
<p>I tried <a href="http://pastebin.com/RmJHheKw">implementing this DP</a>, but there are loads of bugs and it does'nt yield any results... Help creating a better reccurence and/or in debugging my code will be appreciatted. thanks in advance...</p>enThu, 17 Jan 2019 06:26:32 -0000