> //the max(0, ...) is not really necessary I think > capacities[i] = Math.max(0, Math.min(cashier.M, > (T-cashier.P)/cashier.S));
Hello, I wrote almost exactly the same algorithm as you. Just organized differently. I also had a persistent "Wrong Answer" as a result and couldn't figure out why. In my case the reason was that I did not check the case where the packing time exceeds the time being tested, leading to negative capacities. So the Math.max(0,...) above is in fact useful. Maybe it has saved you another headache. -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/73acb9f5-9324-46ad-9e4d-2b7ccd391f1a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
