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. CG-CTF | Hello,RE!

    菜狗开始向着pwn与re进军了(●'◡'●)[说白了,还是在水博客吧] 按r出flag: galf    leW{    emoc    _oT_    W_ER  dlro   }! 反一下:fla ...

  2. ASP.NET MVC 下拉的使用(ViewData传递)

    C#部分 public void GetViewData() { List<string> data = new List<string>(); data.Add(" ...

  3. iOS环境搭建

    Xcode安装 一定要在App Store上下载XCode . git config常用配置 设置lg命令 查看分支图 git config --global alias.lg "log - ...

  4. docker学习与应用

    概要 众所周知,Docker是当前非常火的虚拟化容器技术,对于它的优势以及使用场景网上的资料非常多,这里我推荐大家去这个网站去详细学习docker. 我这里就写一下作为一名后端开发程序员,自己学习do ...

  5. leetcode-mid-Linked list-160 Intersection of Two Linked Lists-NO

    mycode 用了反转链表,所以不符合题意 参考: 思路: 1 先让长的链表先走,然后相同长度下看是否相遇 class Solution(object): def getIntersectionNod ...

  6. 《JavaScript 高级程序设计》

    第 3 章 基本概念 3.5.2 位操作符 ECMAScript 中所有数值都是以 IEEE-754 64 位格式存储,但位操作符并不直接操作 64 位的值.而是先将 64 位的值转换成 32 位的整 ...

  7. Delphi XE2 之 FireMonkey 入门(23) - 数据绑定: TBindingsList: TBindExpression

    准备用 TBindingsList 重做上一个例子. 可以先把 TBindingsList 理解为是一组绑定表达式(TBindExpression)的集合;官方应该是提倡在设计时完成 TBindExp ...

  8. Win32InputBox,C接口的,实现类似VB的InputBox的功能

    #ifndef __03022006__WIN32INPUTBOX__ #define __03022006__WIN32INPUTBOX__ /* This library is (c) Elias ...

  9. golang http Specifically check for timeout error

    Specifically check for timeout error 特异性识别 golang http client 的超时错误 package main import ( "fmt& ...

  10. netcore2.1 在后台运行一个任务

    在 ASP.NET Core 2.1中, 提供了一个名为BackgroundService的类,在 Microsoft.Extensions.Hosting命名空间中,其代码为 namespace M ...