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.

Sample test(s)
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
 //代码心得:用cmp  5178 ms:用运算符重载  1590 ms!!!!
//编程心得:当 边从大到小排完序后 要判断这条边是否
//与之前的边可以构成三角形;可以用bitset (v[i] & v[j]).any()
//如果true 说明 存在k 与 i,j都有边 且ki与kj都大于ij!!! #include<stdio.h>
#include<string.h>
#include<math.h>
#include<set>
#include<vector>
#include<map>
#include<queue>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <bitset>
using namespace std; const int N = ; struct node {
int d;
int i, j;
bool operator<(node a) const
{
return d>a.d;//从大到小!!!!
}
}a[N * N]; int x[N], y[N];
bitset<N> v[N]; int main() {
int n;
scanf("%d", &n);
for (int i = ; i < n; i++) scanf("%d%d", &x[i], &y[i]);
int na = ;
for (int i = ; i < n; i++)
for (int j = i + ; j < n; j++) {
a[na].i = i; a[na].j = j;
int dx = x[i] - x[j];
int dy = y[i] - y[j];
a[na].d = dx * dx + dy * dy;
na++;
}
sort(a, a + na);
int ans;
//for(int i=0;i<na;i++) printf("%.4f**\n", sqrt(a[i].d));
for (int k = ; k < na; k++) {
int i = a[k].i, j = a[k].j;
if ((v[i] & v[j]).any()) {
ans = a[k].d;
break;
}
v[i][j] = v[j][i] = ;
}
printf("%.10f\n", sqrt(ans) * 0.5);
return ;
}

codeforces Summer Earnings(bieset)的更多相关文章

  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

    time limit per test 9 seconds memory limit per test 256 megabytes input standard input output standa ...

  4. Codeforces 333E Summer Earnings ——Bitset

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

  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. Sonys TRC save data plolicy

    帖子地址:https://forums.unrealengine.com/showthread.php?130820-Sonys-TRC-save-data-plolicy we had severa ...

  2. WWDC2017-advanced_animations_with_uikit

    最后修改时间: 2017-12-1 官方视频链接 这个Session主要讲一下的几个内容: Basic(基础的): 动画工作原理 以及 动画如何计时 Interactive and Interrupt ...

  3. 阿里云服务器+ubantu+nodejs 服务器基本配置流程

    所有步骤在MAC 电脑环境下操作 一.配置环境 1.连接到远程服务器 1.购买阿里云ECS服务器,我选用的 ubantu 14.0.4 (64位),购买的时候输入的密码记录下来,没有设置的话可以随后在 ...

  4. C#和.NET获取绝对路径

    c#获取绝对路径:System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log.txt"); .net获取绝 ...

  5. JS text节点无innerHTML

    在线预览 text节点无innerHTML这个属性!!! 如果直接修改text节点的属性(data,nodeValue,textContent),或者使用js原生的修改text节点的内容的方法都会将H ...

  6. 006-spring-data-elasticsearch 3.0.0.0使用【四】-spring-data之Elasticsearch Repositories

    续 二.Elasticsearch Repositories 2.1.简介 2.1.1.Spring命名空间 Spring Data Elasticsearch模块包含一个允许定义存储库bean的自定 ...

  7. 阶段1 语言基础+高级_1-3-Java语言高级_06-File类与IO流_08 转换流_1_字符编码和字符集

     

  8. 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_06 Set集合_4_Set集合存储元素不重复的原理

    set集合元素为什么不能重复 集合重写了toString的方法所以打印是里面的内容 往里面存了三次abc 哈希表,初始容量是16个 set集合存储字符串的时候比较特殊 横着是数组,竖着就是链表结构.跟 ...

  9. 类HashMap

    /* * Map集合的特点 * 将键映射值的对象,一个映射不能包含重复的值:每个键最多只能映射到一个值 * * Map集合和Collection集合的区别? * Map集合存储元素是成对出现的,Map ...

  10. C#怎么让字符串定长,不够的用空格补齐

    string.PadLeft 或者 string.PadRight  : string.PadLeft 表示如果一个字符串的长度小于指定的值,则在字符串的左侧(也就是前面)用指定的字符填充,直到字符串 ...