time limit per test

9 seconds

memory limit per test

256 megabytes

input

standard input

output

standard output

Many schoolchildren look for a job for the summer, and one day, when Gerald was still a schoolboy, he also decided to work in the summer. But as Gerald was quite an unusual schoolboy, he found quite unusual work. A certain Company agreed to pay him a certain sum of money if he draws them three identical circles on a plane. The circles must not interfere with each other (but they may touch each other). He can choose the centers of the circles only from the n options granted by the Company. He is free to choose the radius of the circles himself (all three radiuses must be equal), but please note that the larger the radius is, the more he gets paid.

Help Gerald earn as much as possible.

Input

The first line contains a single integer n — the number of centers (3 ≤ n ≤ 3000). The following n lines each contain two integers xi, yi( - 104 ≤ xi, yi ≤ 104) — the coordinates of potential circle centers, provided by the Company.

All given points are distinct.

Output

Print a single real number — maximum possible radius of circles. The answer will be accepted if its relative or absolute error doesn't exceed 10 - 6.

Examples
input
3
0 1
1 0
1 1
output
0.50000000000000000000
input
7
2 -3
-2 -3
3 0
-3 -1
1 -2
2 -2
-1 0
output
1.58113883008418980000

位运算

在点与点之间两两连边,边按边权从大到小排序。

从大到小依次加边,当图中首次出现三元环时,可以画出满足要求的圆,此时加入的这条边/2就是最大半径。

是否出现环可以用bitset位运算判断。

 /*by SilverN*/
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<bitset>
using namespace std;
const int mxn=;
int read(){
int x=,f=;char ch=getchar();
while(ch<'' || ch>''){if(ch=='-')f=-;ch=getchar();}
while(ch>='' && ch<=''){x=x*+ch-'';ch=getchar();}
return x*f;
}
struct pt{int x,y;}a[mxn];
struct edge{int x,y;double w;
}e[mxn*mxn/];
int cmp(const edge a,const edge b){return a.w>b.w;}
int ect=;
bitset<>b[];
int n;
int main(){
int i,j;
n=read();
for(i=;i<=n;i++){
a[i].x=read();a[i].y=read();
}
for(i=;i<n;i++)
for(j=i+;j<=n;j++){
e[++ect]=(edge){i,j,sqrt((double)(a[i].x-a[j].x)*(a[i].x-a[j].x)+(a[i].y-a[j].y)*(a[i].y-a[j].y))};
}
sort(e+,e+ect+,cmp);
for(i=;i<=ect;i++){
int u=e[i].x,v=e[i].y;
if((b[u]&b[v]).any()){
printf("%.8f\n",e[i].w/);return ;
}
b[u][v]=;b[v][u]=;
}
return ;
}

CodeForces 333E. Summer Earnings的更多相关文章

  1. Codeforces 333E Summer Earnings - bitset

    题目传送门 传送门I 传送门II 传送门III 题目大意 给定平面上的$n$个点,以三个不同点为圆心画圆,使得圆两两没有公共部分(相切不算),问最大的半径. 显然答案是三点间任意两点之间的距离的最小值 ...

  2. Codeforces 333E Summer Earnings(bitset)

    题目链接 Summer Earnings 类似MST_Kruskal的做法,连边后sort. 然后对于每条边,依次处理下来,当发现存在三角形时即停止.(具体细节见代码) 答案即为发现三角形时当前所在边 ...

  3. Codeforces 333E Summer Earnings ——Bitset

    [题目分析] 找一个边长最大的三元环. 把边排序,然后依次加入.加入(i,j)时,把i和j取一个交集,看看是否存在,存在就找到了最大的三元环. 输出即可,n^3/64水过. [代码] #include ...

  4. codeforces Summer Earnings(bieset)

    Summer Earnings time limit per test 9 seconds memory limit per test 256 megabytes input standard inp ...

  5. Codeforces 1107G Vasya and Maximum Profit 线段树最大子段和 + 单调栈

    Codeforces 1107G 线段树最大子段和 + 单调栈 G. Vasya and Maximum Profit Description: Vasya got really tired of t ...

  6. CF333E Summer Earnings

    CF333E Summer Earnings 题目 https://codeforces.com/problemset/problem/333/E 题解 思路 知识点:枚举,图论,位运算. 题目要求从 ...

  7. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  8. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  9. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

随机推荐

  1. Ubuntu下命令行访问网站

      第一步,需要安装一个名为w3m的软件工具,打开终端,输入如下命令 sudo apt-get install w3m 第二步,安装好w3m之后,在终端里面启动w3m,打开一个网址,比如w3m www ...

  2. 函数的扩展——箭头函数this的使用

    箭头函数中的this指向的是定义时的this,而不是执行时的的this . 举例: 案例中,我们的obj对象中有一个属性x和一个属性show( )方法,show( )通过this打印出x的值,结果是u ...

  3. json_decode()和json_encode()区别----2015-0929

    json_decode对JSON格式的字符串进行编码而json_encode对变量进行 JSON 编码,需要的朋友可以参考下   1.json_decode() json_decode (PHP 5 ...

  4. 53. Maximum Subarray@python

    Given an integer array nums, find the contiguous subarray (containing at least one number) which has ...

  5. Linux - 链接概念详解

    1> Linux链接概念Linux链接分两种,一种被称为硬链接(Hard Link),另一种被称为符号链接(Symbolic Link).默认情况下,ln命令产生硬链接. [硬连接]硬连接指通过 ...

  6. Python中类的声明,使用,属性,实例属性,计算属性及继承,重写

    Python中的类的定义以及使用: 类的定义: 定义类 在Python中,类的定义使用class关键字来实现 语法如下: class className: "类的注释" 类的实体 ...

  7. Applied Nonparametric Statistics-lec8

    Ref:https://onlinecourses.science.psu.edu/stat464/print/book/export/html/11 additive model value = t ...

  8. LeetCode(226)Invert Binary Tree

    题目 分析 交换二叉树的左右子树. 递归非递归两种方法实现. AC代码 class Solution { public: //递归实现 TreeNode* invertTree(TreeNode* r ...

  9. hdu-2553 N皇后问题(搜索题)

    在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上. 你的任务是,对于给定的N,求出有多少种合法的放置方法. Inpu ...

  10. TTL与COMS的区别

    1.电平的上限和下限定义不一样,CMOS具有更大的抗噪区域. 同是5伏供电的话,ttl一般是1.7V和3.5V的样子,CMOS一般是  2.2V,2.9V的样子,不准确,仅供参考. 2.电流驱动能力不 ...