Ok, practice is working now, and integer overflow was indeed the problem.
One place where you have integer overflow that's harder to notice is this line:

B -= capacities[i];

B needs to be of type long there, to avoid negative overflow.
Of course, that's besides all the other places where you should use long/Long.

-- 
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 google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/80c57bbb-beb7-4ca8-93e6-a5559e9be04e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to