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. mac 升级EI Capitan后遇到c++转lua时遇到libclang.dylib找不到的错

    升级EI Capitan后,打包lua脚本时,会报这个错: LibclangError: dlopen(libclang.dylib, 6): image not found. To provide ...

  2. salt 模板

    http://www.mamicode.com/info-detail-2297406.html

  3. Maven配置项目依赖使用本地仓库的方法汇总

    Maven配置项目使用本地仓库有以下方式实现: 1.类似本地仓库,但是属于本地依赖,比如某个JAR包是引用第三方的,直接放在了项目的lib文件夹,那么此时可以如下配置项目的POM: <depen ...

  4. UIAutomator输入中文

    之前一直是英文的测试环境,包括手机也是英文的,app也是英文的,涉及不到中文输入法的东西.但现在在写中文的app,所以需要输入中文.看到网上的解决办法如下: 下载https://github.com/ ...

  5. Django基于Pycharm开发之二 [使用django adminSite]

    在使用django自带的adminsite的时候,有以下内容需要做. 1.数据迁移,管理表的创建. 2.启用本地化 (setting.py的配置) 一.数据迁移,默认情况下,安装django之后,dj ...

  6. Java做爬虫也很方便

    首先我们封装一个Http请求的工具类,用HttpURLConnection实现,也可以用HttpClient, 或者直接用Jsoup来请求. 工具类实现比较简单,就一个get方法,读取请求地址的响应内 ...

  7. PYday15--面向对象的进阶:集成、成员、方法、异常处理

    1.继承 实例: 2.构造方法: 3.反射:以字符串的形式去模块操作其成员. 成员: 最外层是文件,文件里面包含类,通过类可以创建对象,对象可以封装字段和指针.类里面可以有方法,指针可以指向方法. 通 ...

  8. luogu1208 尼克的任务

    倒着推就是了 #include <iostream> #include <cstdio> #include <vector> using namespace std ...

  9. 运行Android程序出错:The connection to adb is down, and a severe error has occured

    调试Android程序时候,报错如下: [2013-02-21 15:41:06 - MainActivity] ------------------------------[2013-02-21 1 ...

  10. 面向对象编程(二)封装--构造方法,this关键字,static关键字,方法重载

    面向对象三大特点:封装.继承.多态 封装概念 ①   将东西包装在一起,然后以新的完整形式呈现出来: 将方法和字段一起包装到一个单元中,单元以类的形式实现; ②   信息隐藏,隐藏对象的实现细节,不让 ...