Editorial for VMSS '15 #3 - Jeffrey and Roads
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Note that since the roads extend forever, it is impossible for Jeffrey to go "around" the lines to the school. Thus Jeffrey has to cross a road if and only if he and the school are on different sides of the road.
Now how do we check if they're on different sides? Notice that the equation for the roads are conveniently given to use in
Now with that info in mind, we can see Jeffrey and the school are on different sides of the road if one is negative and the other is positive.
Final Complexity:
Comments