heartlessly / heartlessly.github.io

A blog for Heartlessly
1 stars 0 forks source link

「Luogu P3964」「TJOI2013」松鼠聚会 | Heartlessly's Blog #142

Open heartlessly opened 5 years ago

heartlessly commented 5 years ago

https://heartlessly.github.io/problems/luogu-p3964/

Description给定 $n$ 个点,每个点的坐标为 $(x_i,y_i)$,且点 $(x,y)$ 到它周围 $8$ 个点 $(x-1,y)(x+1,y),(x,y-1),(x,y+1).(x-1,y+1),(x-1,y-1),(x+1,y+1),(x+1,y-1)$ 的距离均为 $1$ 。现要找到一个点,使其它点到这个点的距离和最小,输出这个最小值。 $(0 \leq n \leq 10^5