POJ - 3525 E - Most Distant Point from the Sea(半平面交+二分)
POJ - 3525 E - Most Distant Point from the Sea 题意:给你一个日本, 日本中有一个地方, 离海的最近距离比其他地方的最近距离都大.要你求该地到海的最近距离. 也就是给你一个凸包, 在里面放一个最大的圆, 求出圆的半径 解法: 可以二分半径 每次将所有线段向圆心平移mid个单位长度 如果还存在核,则l=mid,否则r=mid 代码: # include <cmath> # include <cstdio> # include <cstring> # include <algorithm> using namespace std ; const int MAXN = 1e3 + 5 ; const double EPS = 1e-9 ; const double PI = acos ( - 1 ) ; inline int sgn ( double a ) { return a < - EPS ? - 1 : a > EPS ; } inline int cmp ( double a , double b ) { return sgn ( a - b ) ; } int n , m , T ; struct Point ; struct Line ; typedef Point Vector ; struct Point { double