The first car has reached the edge of the second car at 12, they are
bumper to bumper, and the third car is on the side (just like your
diagram), since car 1 is faster it cant go on after second 12 so it
must turn off cruise control at exactly 12 (if it goes to 13 they
would have crashed already)

On Apr 29, 2:16 pm, xenoky <[email protected]> wrote:
> Hi,
>
> The 4th test case in the Cruise Control problem has the following
> input:
> 4
> L 4 0
> L 2 29
> L 1 35
> L 1 44
>
> The given solution is:
> Case #4: 12
>
> calculating the distance at t=12
>
> 4*12=48
> 2*12+29=53
> 12+35=47
> 12+44=56
>
> ordering this distance [47,48,53,56]
>
> The maximum distance beetween nearest triplet is 6! -> [47,48,53]
>
> I can put the car this way
>
> ##### #####
>  #####
>
> without accident
>
> Where am i wrong?
>
> My program answer is 13...

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en.

Reply via email to