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. IntelliJ IDEA 开发工具的一些设置

    IntelliJ IDEA 开发工具的一些设置 参考资料 IntelliJ IDEA 的学习,离不开网络上技术热爱者们的分享,在此向他们表示感谢. 成吨提高开发效率:https://github.co ...

  2. 设计 4 个线程,其中两个线程每次对 j 增加 1,另外两个线程对 j 每次减少 1。写出程序。

    先设计一个类处理加减这一行为: public class ManyThread { private int j = 0; public synchronized void inc(){ j++; Sy ...

  3. 在Ubuntu18.04下安装Java 11

    一直以来,本人都使用第三方软件包"ppa:linuxuprising/java"安装Java JDK,最近一次安装时发现无法成功.这是由于现在无法直接从Oracle官网下载Java ...

  4. Customizable Route Planning

    w https://www.microsoft.com/en-us/research/wp-content/uploads/2011/05/crp-sea.pdf 1 Introduction The ...

  5. mysql 无法存储表情字符 java.sql.SQLException: Incorrect string value: '\xF0\x9F\x90\xBE",...' for column 'XXXX' at row 1

    1.变更字段类型 ALTER TABLE api_log MODIFY COLUMN remark longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_uni ...

  6. 阶段1 语言基础+高级_1-3-Java语言高级_1-常用API_1_第7节 Arrays工具类_16_数组工具类Array

    在java.util的包下面.在这个包的下面是需要导包的,只有lang 的包下面是不需要导包的 查看jdk1.6的手册 Arrays让我们想起了数组,说明它提供了与数组相关的方法 我们可以看到 toS ...

  7. 阶段1 语言基础+高级_1-3-Java语言高级_04-集合_06 Set集合_7_可变参数

    打印出来是一个数组的地址 打印数组的长度 只要调用了add方法就会创建一各长度为0的数组 传一个10过去.就输出了数组的长度为1 传两个数字 注意事项: 特殊写法

  8. shell脚本一一项目6

    主题:获取网卡的流量 ifconfig 查看流量 文件流量数据量 脚本内容 #!/bin/bash#name: mark# check network dev's liuliangnic=$1 ech ...

  9. axios 获取不到数据错误

    1.问题: 打算学习下vue,但是vue-resource作者已经不更新了,并且大家都建议用axios来进行前后端交互,所以就从学习axios开始. 但是在使用 axios 的过程中,自己写的接口竟然 ...

  10. 【GTS】关于GtsTetheringTestCases模块的几个失败项

    GTS---关于GtsTetheringTestCases模块的几个失败项 1.run gts -m GtsTetheringTestCases -t com.google.android.tethe ...