链接 O(n^3)的做法: 枚举任意两点为弦的圆,然后再枚举其它点是否在圆内. 用到了两个函数 atan2反正切函数,据说可以很好的避免一些特殊情况 #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<stdlib.h> #include<vector> #include<cmath> #include<…
题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1338 1338: Pku1981 Circle and Points单位圆覆盖 Time Limit: 3 Sec  Memory Limit: 162 MBSubmit: 190  Solved: 79[Submit][Status][Discuss] Description You are given N points in the xy-plane. You have a circ…
题目链接:http://poj.org/problem?id=1981 容易想到直接枚举两个点,然后确定一个圆来枚举,算法复杂度O(n^3). 这题还有O(n^2*lg n)的算法.将每个点扩展为单位圆,依次枚举每个单位圆,枚举剩下的单位圆,如果有交点,每个圆产生两个交点,然后对产生的2n个交点极角排序,判断被覆盖最多的弧,被覆盖相当于这个弧上的点为圆心的圆可以覆盖到覆盖它的那些点,所以被覆盖最多的弧就是答案了. O(n^3): //STATUS:C++_AC_4032MS_208KB #inc…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Circle and Points Time Limit: 5000MS   Memory Limit: 30000K Total Submissions: 6850   Accepted: 2443 Case Time Limit: 2000MS Description You are given N points in the xy-plane. You have a cir…
<题目链接> <转载于 >>>  > 题目大意: 在二维平面上给出n条不共线的线段(线段端点是整数),问这些线段总共覆盖到了多少个整数点. 解题分析: 用GCD可求的某条给定线段上有多少个整数点,理由如下: GCD(n,m)为n与m的最大公约数,通过辗转相除法求得.令g=GCD(n,m); n=x*g, m=y*g.所以将横坐标分为g个x份,将纵坐标分为g个y份.所以,本题线段覆盖的整数点个数为 g+1 (因为包含端点,如果不包含端点就为 g-1 ). 但是这样求…
Circle and Points Time Limit: 5000MS   Memory Limit: 30000K Total Submissions: 7327   Accepted: 2651 Case Time Limit: 2000MS Description You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enc…
Catching Fish Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1741    Accepted Submission(s): 686 Problem Description Ignatius likes catching fish very much. He has a fishnet whose shape is a c…
Search GO 说明:输入题号直接进入相应题目,如需搜索含数字的题目,请在关键词前加单引号 Problem ID Title Source AC Submit Y 1000 A+B Problem 10983 18765 Y 1036 [ZJOI2008]树的统计Count 5293 13132 Y 1588 [HNOI2002]营业额统计 5056 13607 1001 [BeiJing2006]狼抓兔子 4526 18386 Y 2002 [Hnoi2010]Bounce 弹飞绵羊 43…
Circle and Points Time Limit: 5000MS   Memory Limit: 30000K Total Submissions: 8131   Accepted: 2899 Case Time Limit: 2000MS Description You are given N points in the xy-plane. You have a circle of radius one and move it on the xy-plane, so as to enc…
Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. 解题思路: 本题主要需要考虑到斜线的情况,可以分别计算出过points[i]直线最多含几个点,然后算出最大即可,由于计算points[i]的时候,前面的点都计算过了,所以不需要把前面的点考虑进去,所以问题可以转化为过points[i]的直线最大点的个数,解题思路是用一个HashMap储存斜率,遍历p…