tag:blogger.com,1999:blog-7656516316687795220.post3554018597431133587..comments2013-02-24T07:18:07.217-08:00Comments on I solved a problem: Maxim and Restaurant (Part 1)Arif Zamanhttps://plus.google.com/108003422400589431906noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-7656516316687795220.post-9225418505404155122013-02-24T07:18:07.217-08:002013-02-24T07:18:07.217-08:00@Piyush:
Note that, for each blocker we are initia...@Piyush:<br />Note that, for each blocker we are initializing the dp -<br />double[][] dp = new double[n][p + 1];Md. Arifuzzaman Arifhttps://www.blogger.com/profile/05427068343601711364noreply@blogger.comtag:blogger.com,1999:blog-7656516316687795220.post-79140531241722196062013-02-24T04:23:05.418-08:002013-02-24T04:23:05.418-08:00Won&#39;t this lead to situation where same elemen...Won&#39;t this lead to situation where same element gets considered twice ??<br /><br />Suppose third element has length=3<br /><br />1. dp[0][0]=1<br />2. First element is blocker, so dp[1][3] gets some value.<br />3. Second element is blocker, so dp[2][6] gets some value.<br /><br />In third step, dp[2][6] gets some value which is not valid.<br /><br /><br /><br />Piyushhttps://www.blogger.com/profile/11856902857473486698noreply@blogger.com