ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1384. Goat in the Garden 4

seems there is O(n*log(n)) solution of this problem.
Posted by Shen Yang 17 Mar 2017 06:30
using binary search r, and check for each segment,find the inner side part of other segment
that distance is smaller than 2*r,get the segment of these points in each line, check if union of them is the hole line segment.

for check two segments' distance we only need to check innerside adjctent two line segments

it can be done by O(n*log(n)) sweepline precalculate..
Re: seems there is O(n*log(n)) solution of this problem.
Posted by Shen Yang 17 Mar 2017 06:35
admin please set another version with n<=100000.