Variant of EPI for java (Ninja prob) 22.30 the view from above

#1

Hello,

I am working on the variant of the view from above.
The question is asking “runners R1 to Rn race on a track of length L. Runner Ri begins at an offset si from the start of the trak, and runs at speed vi. compute the set of runners that lead at some time”.

There is a similar variant problem for 22.34 count the inversions “to count the number of runners crosses”. I can solve that. But can anybody give some hint as for the current variant problems?

THanks

JJ

0 Likes

#2

Hey @monkeyKing,

The key here is to visualize those runners as a set of line segments and transform this problem in the view from above problem, and then solve that. How to visualize those runners with those parameters is the key to solve this problem.

0 Likes