Page 1 of 1

882 - The Mailbox Manufacturers Problem

Posted: Sat Aug 13, 2005 7:08 pm
by jagadish
I dont understand how the answer for
5 100 is 495 AFAIK the answer is 449, with the number of crakers taken at each step being:
71
87
94
98
99

But sample i/o is scarcely wrong - have i misunderstood the problem ?

882 - Mailbox Manufacturers Problem

Posted: Wed Aug 02, 2006 9:45 pm
by henrique.renno
Hello!!! :)

How can I use DP to solve this problem??? Some ideas?

Thanks for the attention. :P

You can solve problem by using DP

Posted: Fri Feb 22, 2008 4:36 am
by yjwoo14
I got accept by using DP.

I use 3-dimension matrix.

matrix[k][s][l]

k is capcity the number of mailbox.

s is start the number of crackers

l is length...

so matrix[k][s][l] mean is i have 1 mailbox and..

minimum the number of crackers in range s, s + 1, s+ 2 , .... , (s + l - 1)

sorry I can`t speak english very well ;)

Posted: Tue Mar 11, 2008 6:40 pm
by redghost
Can you explain how your solution works ? plz

This is solution

Posted: Sun Mar 16, 2008 3:43 pm
by yjwoo14
matrix[i][s][l] = max[v = s ~ s + l - 1](matrix[i - 1][s][v - s] + v, matrix[i][v + 1][(s + l) - v - 1] + v)

you can get matrix[i][s][l] mean in before post.