tag:blogger.com,1999:blog-29632375.post6449371866349260934..comments2023-06-19T19:45:40.281-07:00Comments on vexorian's blog: Another week another TCO 2013 editorial: 1BUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-29632375.post-25047660885240656682013-03-03T13:26:33.440-08:002013-03-03T13:26:33.440-08:00You have a set of elements you want to remove.
Li...You have a set of elements you want to remove.<br /><br />Like ---x---xxxx-xx--- , you want to remove the xs. We represent this as a bitmask: 00010001111011000_2<br /><br />f( mask ) finds the minimum number of steps.<br /><br /><br />Base case: mask == 0, then we need 0 steps.<br /><br /><br />Then we can do this: Pick i - position which we use to remove the L consecutive spaces.<br />You modify the mask and replace the L bits starting at i with 0s. This new mask is a new case that we can call f(new_mask). The final result is 1 + min( f(new_mask_i)) for each i.vexoriannoreply@blogger.comtag:blogger.com,1999:blog-29632375.post-47620756985640053602013-03-03T03:25:20.419-08:002013-03-03T03:25:20.419-08:00Could you give the solution for 500 using dp pleas...Could you give the solution for 500 using dp please?Mikinoreply@blogger.comtag:blogger.com,1999:blog-29632375.post-34502086014589182852013-03-02T23:16:08.935-08:002013-03-02T23:16:08.935-08:00>> Everyone seems to know to use that soluti...>> Everyone seems to know to use that solution. <br /><br />Not really. It was intuitive but I thought there was a catch and solution may fail systest. Since N can be atmost 50, can't we simply bruteforce for all possible values ?<br /><br />Looking forward to the proof.wolfwoodnoreply@blogger.com