I've not read the whole solution, sorry (I most go out in minutes), but an integer overflow when you compute your maxTime is a problem for sure. You may need full-blown 64 bits for the maximum time. Or just hardcode it to 10^18+10^9. Feel free to compare with my solution at https://github.com/salvois/codejam
-- 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/339a85de-c4ab-43f1-b81b-3330480f0f55%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.