Catching Fish

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1217    Accepted Submission(s): 466

Problem Description
Ignatius
likes catching fish very much. He has a fishnet whose shape is a circle
of radius one. Now he is about to use his fishnet to catch fish. All
the fish are in the lake, and we assume all the fish will not move when
Ignatius catching them. Now Ignatius wants to know how many fish he can
catch by using his fishnet once. We assume that the fish can be regard
as a point. So now the problem is how many points can be enclosed by a
circle of radius one.

Note: If a fish is just on the border of the fishnet, it is also caught by Ignatius.

 
Input
The
input contains several test cases. The first line of the input is a
single integer T which is the number of test cases. T test cases follow.
Each
test case starts with a positive integer N(1<=N<=300) which
indicate the number of fish in the lake. Then N lines follow. Each line
contains two floating-point number X and Y (0.0<=X,Y<=10.0). You
may assume no two fish will at the same point, and no two fish are
closer than 0.0001, no two fish in a test case are approximately at a
distance of 2.0. In other words, if the distance between the fish and
the centre of the fishnet is smaller 1.0001, we say the fish is also
caught.
 
Output
For each test case, you should output the maximum number of fish Ignatius can catch by using his fishnet once.
 
Sample Input
4
3
6.47634 7.69628
5.16828 4.79915
6.69533 6.20378
6
7.15296 4.08328
6.50827 2.69466
5.91219 3.86661
5.29853 4.16097
6.10838 3.46039
6.34060 2.41599
8
7.90650 4.01746
4.10998 4.18354
4.67289 4.01887
6.33885 4.28388
4.98106 3.82728
5.12379 5.16473
7.84664 4.67693
4.02776 3.87990
20
6.65128 5.47490
6.42743 6.26189
6.35864 4.61611
6.59020 4.54228
4.43967 5.70059
4.38226 5.70536
5.50755 6.18163
7.41971 6.13668
6.71936 3.04496
5.61832 4.23857
5.99424 4.29328
5.60961 4.32998
6.82242 5.79683
5.44693 3.82724
6.70906 3.65736
7.89087 5.68000
6.23300 4.59530
5.92401 4.92329
6.24168 3.81389
6.22671 3.62210
 
Sample Output
2
5
5
11
 
Author
Ignatius.L
 
Recommend
We have carefully selected several similar problems for you:  1056 1079 1071 1099 1066
 
 
枚举两点,计算已知过两点和半径的圆心。
O(n^3)

hduoj 1077 Catching Fish 求单位圆最多覆盖点个数的更多相关文章

  1. HDU 1077 Catching Fish(用单位圆尽可能围住多的点)

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1077 Catching Fish Time Limit: 10000/5000 MS (Java/Oth ...

  2. (水题)HDU - 1077 - Catching Fish - 计算几何

    http://acm.hdu.edu.cn/showproblem.php?pid=1077 很明显这样的圆,必定有两个点在边界上.n平方枚举圆,再n立方暴力判断.由于没有给T,所以不知道行不行.

  3. hdu4106 区间k覆盖问题(连续m个数,最多选k个数) 最小费用最大流 建图巧妙

    /** 题目:hdu4106 区间k覆盖问题(连续m个数,最多选k个数) 最小费用最大流 建图巧妙 链接:http://acm.hdu.edu.cn/showproblem.php?pid=4106 ...

  4. Catching Fish[HDU1077]

    Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)To ...

  5. TZOJ 2392 Bounding box(正n边形三点求最小矩形覆盖面积)

    描述 The Archeologists of the Current Millenium (ACM) now and then discover ancient artifacts located ...

  6. [ACM_暴力] 最多交换k个数的顺序,求a[i]的最大连续和

    /* http://codeforces.com/contest/426/problem/C 最多交换k个数的顺序,求a[i]的最大连续和 爆解 思路:Lets backtrack interval ...

  7. [hdu5251]矩形面积 旋转卡壳求最小矩形覆盖

    旋转卡壳求最小矩形覆盖的模板题. 因为最小矩形必定与凸包的一条边平行,则枚举凸包的边,通过旋转卡壳的思想去找到其他3个点,构成矩形,求出最小面积即可. #include<cstdio> # ...

  8. 容斥原理应用(求1~r中有多少个数与n互素)

    问题:求1~r中有多少个数与n互素. 对于这个问题由容斥原理,我们有3种写法,其实效率差不多.分别是:dfs,队列数组,位运算. 先说说位运算吧: 用二进制1,0来表示第几个素因子是否被用到,如m=3 ...

  9. Acdream1084 寒假安排 求n!中v因子个数

    题目链接:pid=1084">点击打开链接 寒假安排 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 ...

随机推荐

  1. mybatis0203 一对一查询 resultMap实现

    resultType实现的时候先要确定po类(数据库类)满不满足要求,如果不满足就要自定义一个pojo类(工具类). resultMap提供一对一关联查询的映射和一对多关联查询映射,一对一映射思路:将 ...

  2. 刷leetcode

    目前已经刷到了56题,才到1/3,后面越来越难,不知道能不能在面微软之前刷完.

  3. 基于heartbeat的单播方式实现tomcat高可用

    1.节点规划 在master.backup节点上添加eth0.eth1两网卡,具体添加过程,参考“基于VMware为CentOS 6.5配置两个网卡” 2.IP规划   master backup e ...

  4. oracle多表查询

    多表查询首先要避免笛卡尔集,要避免笛卡尔集,那么查询条件不得少于表的个数-1. 1.显示雇员名,雇员工资以及雇员所在的部门: 2.显示部门号为10的部门名.员工名和工资: 3.显示各个雇员的姓名,工资 ...

  5. centos 安装mysqldb 记录

    vim setup_pofix.py #修改mysql_config路径 <pre> ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /us ...

  6. RedHat7搭建无人值守自动安装Linux操作系统(PXE+Kickstart)

    Kickstart服务器 IP: 192.168.136.253   掩码:255.255.255.0   网关:192.168.136.2   DNS:192.168.136.2 安装部署HTTP服 ...

  7. JavaScript的DOM操作(三)

    1.相关元素操作: var a = document.getElementById("id"); var b = a.nextSibling,找a的下一个同辈元素,注意空格 var ...

  8. Silverlight实用窍门系列:47.Silverlight中元素到元素的绑定,以及ObservableCollection和List的使用区别

    问题一:在某一些情况下,我们使用MVVM模式的时候,对于某一个字段(AgeField)需要在前台的很多个控件(A.B.C.D.E)进行绑定,但是如何能够让我们后台字段名改变的时候能够非常方便的改变所有 ...

  9. Repeater为空时显示“暂无数据”,很方便实用方法

    Repeater为空时显示“暂无数据”,很方便实用方法 <FooterTemplate>   <asp:Label ID="lblEmptyZP" Text=&q ...

  10. python基础知识二

    对象 python把在程序中用到的任何东西都成为对象. 每一个东西包括数.字符串甚至函数都是对象. 使用变量时只需要给他们赋一个值.不需要声明或定义数据类型. 逻辑行与物理行 物理行是你在编写程序时所 ...