The reference solution to this problem is incorrect. If you read the reference source, you can see that it does point-line distance computation instead of point-segment distance computation. If you read the problem statement, it only matters what the distance is from the segment from point A to point B, not the infinite line.
This is clearly shown by the sample, since the segment from point A to point B in the first test case does not touch any circle, so we expect the answer to be 0 instead of 2.
Attached to this message is an updated ZIP file that does point-segment distance instead of point-line distance.
xiaowuc1 1년 전
The reference solution to this problem is incorrect. If you read the reference source, you can see that it does point-line distance computation instead of point-segment distance computation. If you read the problem statement, it only matters what the distance is from the segment from point A to point B, not the infinite line.
This is clearly shown by the sample, since the segment from point A to point B in the first test case does not touch any circle, so we expect the answer to be 0 instead of 2.
Attached to this message is an updated ZIP file that does point-segment distance instead of point-line distance.
5243.zip