Editorial for Mock CCC '19 Contest 2 S5 - Tudor Takes Pictures of Goats
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
To rephrase the problem, we need to minimize the number of distinct distances from the given set of points to a point that we can choose.
Assuming , the optimal point clearly lies on the perpendicular bisector between some two points. We can try the midpoint of every pair of points and the intersection of any pair of perpendicular bisectors. There are candidate points to consider, for an algorithm.
Care should be taken to use exact arithmetic everywhere.
Comments