Link
Solution
so that the longest distance between xiaomi's home and the other groundhog's home is minimum.
二分答案?然而二分之后有什么用呢? 注意到,选取一个点,要让平面内所有点到它的距离最近,转化一下,不就是最小覆盖圆吗。。
Tips
在计算几何中,当一般算法题的套路用不上(二分答案。。。),就研究一下求解问题的几何性质(圆。)
Code
1 | //Code by Lucida |
so that the longest distance between xiaomi's home and the other groundhog's home is minimum.
二分答案?然而二分之后有什么用呢? 注意到,选取一个点,要让平面内所有点到它的距离最近,转化一下,不就是最小覆盖圆吗。。
在计算几何中,当一般算法题的套路用不上(二分答案。。。),就研究一下求解问题的几何性质(圆。)
1 | //Code by Lucida |