A9510 | Gena and Second Distance
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Gena doesn't like geometry, so he asks you to solve this problem for him.
A rectangle with sides parallel to coordinate axes contains $n$ dots. Let's consider some point of the plane. Let's count the distances from this point to the given $n$ points. Let's sort these numbers in the non-decreasing order. We'll call the beauty of the point the second element of this array. If there are two mimimum elements in this array, the beaty will be equal to this minimum.
Find the maximum beauty of a point inside the given rectangle.
A rectangle with sides parallel to coordinate axes contains $n$ dots. Let's consider some point of the plane. Let's count the distances from this point to the given $n$ points. Let's sort these numbers in the non-decreasing order. We'll call the beauty of the point the second element of this array. If there are two mimimum elements in this array, the beaty will be equal to this minimum.
Find the maximum beauty of a point inside the given rectangle.
输入格式
The first line contains three integers $w,h,n$ ( $1<=w,h<=10^{6},2<=n<=1000$ ) — the lengths of the rectangle sides and the number of points. Next $n$ lines contain two integers $x_{i},y_{i}$ ( $0<=x_{i}<=w,0<=y_{i}<=h$ ) each — the coordinates of a point. It is possible that it will be coincident points.
输出格式
Print a single number — the maximum beauty of a point with the absolute or relative error of at most $10^{-9}$ .
输入输出样例
输入 #1
5 5 4 0 0 5 0 0 5 5 5
输出 #1
4.99999999941792340
输入 #2
5 5 3 4 0 2 5 4 1
输出 #2
5.65685424744772010
The point which beauty we need to find must have coordinates ( $x,y$ ), where $0<=x<=w,0<=y<=h$ . Some of the $n$ points can coincide.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted