A10737 | Hongcow Draws a Circle
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Hongcow really likes the color red. Hongcow doesn't like the color blue.
Hongcow is standing in an infinite field where there are $n$ red points and $m$ blue points.
Hongcow wants to draw a circle in the field such that this circle contains at least one red point, and no blue points. Points that line exactly on the boundary of the circle can be counted as either inside or outside.
Compute the radius of the largest circle that satisfies this condition. If this circle can have arbitrarily large size, print $-1$ . Otherwise, your answer will be accepted if it has relative or absolute error at most $10^{-4}$ .
Hongcow is standing in an infinite field where there are $n$ red points and $m$ blue points.
Hongcow wants to draw a circle in the field such that this circle contains at least one red point, and no blue points. Points that line exactly on the boundary of the circle can be counted as either inside or outside.
Compute the radius of the largest circle that satisfies this condition. If this circle can have arbitrarily large size, print $-1$ . Otherwise, your answer will be accepted if it has relative or absolute error at most $10^{-4}$ .
输入格式
The first line of the input will contain two integers $n,m$ ( $1<=n,m<=1,000$ ).
The next $n$ lines will contain two integers $x_{i},y_{i}$ ( $1<=x_{i},y_{i}<=10^{4}$ ). This denotes the coordinates of a red point.
The next $m$ lines will contain two integers $x_{i},y_{i}$ ( $1<=x_{i},y_{i}<=10^{4}$ ). This denotes the coordinates of a blue point.
No two points will have the same coordinates.
The next $n$ lines will contain two integers $x_{i},y_{i}$ ( $1<=x_{i},y_{i}<=10^{4}$ ). This denotes the coordinates of a red point.
The next $m$ lines will contain two integers $x_{i},y_{i}$ ( $1<=x_{i},y_{i}<=10^{4}$ ). This denotes the coordinates of a blue point.
No two points will have the same coordinates.
输出格式
Print $-1$ if the circle can have arbitrary size. Otherwise, print a floating point number representing the largest radius circle that satisfies the conditions. Your answer will be considered correct if its absolute or relative error does not exceed $10^{-4}$ .
Namely, let's assume that your answer is $a$ and the answer of the jury is $b$ . The checker program will consider your answer correct if .
Namely, let's assume that your answer is $a$ and the answer of the jury is $b$ . The checker program will consider your answer correct if .
输入输出样例
输入 #1
2 5 2 3 3 4 1 1 1 4 4 2 4 7 2 5
输出 #1
3.5355338827
输入 #2
1 6 3 3 1 5 5 4 2 1 3 4 4 2 1 3
输出 #2
1.5811388195
输入 #3
2 2 2 2 3 3 1 1 4 4
输出 #3
-1
This is a picture of the first sample
This is a picture of the second sample

This is a picture of the second sample

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted