HDU 1432 Lining Up(几何)】的更多相关文章

http://acm.hdu.edu.cn/showproblem.php?pid=1432 题目大意: 2维平面上给定n个点,求一条直线能够穿过点数最多是多少. 解题思路: 因为题目给定的n(1~700),所以枚举,时间复杂度是O(n^3),不会超时. 枚举两个点,然后判断剩下的点是否在这条直线. AC代码: #include<cstdio> struct Point{ int x, y; Point(, ): x(x), y(y){} void scan(){ scanf("%d…
枚举,枚举点 复杂度为n^3. 还能够枚举边的,n*n*log(n). POJ 1118 要推断0退出. #include<cstdio> #include<cstring> #include<string> #include<queue> #include<algorithm> #include<map> #include<stack> #include<iostream> #include<list&…
 Lining Up  ``How am I ever going to solve this problem?" said the pilot. Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangerous area. Furthermore, the pilot could only fly over the area on…
当火车处在换基站的临界点时,它到某两基站的距离相等.因此换基站的位置一定在某两个基站的中垂线上, 我们预处理出任意两基站之间的中垂线,对于每次询问,求询问线段与所有中垂线的交点. 检验这些交点是否满足条件(详见代码),如果满足,那么它是一个交换点. #include <cstdio> #include <cmath> #include <vector> #include <algorithm> using namespace std; ; ; struct…
Problem Description There is a point P at coordinate (x,y). A line goes through the point, and intersects with the postive part of X,Y axes at point A,B. Please calculate the minimum possible value of |PA|∗|PB|.   Input the first line contains a posi…
Mindis Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2787    Accepted Submission(s): 555Special Judge Problem Description The center coordinate of the circle C is O, the coordinate of O is (0,…
WisKey的眼神 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2059    Accepted Submission(s): 625 Problem Description WisKey的眼镜有500多度,所以眼神不大好,而且他有个习惯,就是走路喜欢看着地(不是为了拣钱哦^_^),所以大家下次碰见他的时候最好主动打下招呼,呵呵.但是…
题目链接: POJ:id=3831" target="_blank">http://poj.org/problem?id=3831 HDU:http://acm.hdu.edu.cn/showproblem.php?pid=3264 Description The city of M is a famous shopping city and its open-air shopping malls are extremely attractive. During the…
http://acm.hdu.edu.cn/showproblem.php?pid=1700 题目大意: 二维平面,一个圆的圆心在原点上.给定圆上的一点A,求另外两点B,C,B.C在圆上,并且三角形ABC的周长是最长的. 解题思路: 我记得小学的时候给出个一个定理,在园里面正多边形的的周长是最长的,这个定理我不会证明. 所以这里是三角形,当三角形为正三角形的时候,周长是最长的. 因为圆心在原点,所以我就向量(x,y)绕原点逆时针旋转120度和顺时针旋转120度.给定的点A可以看成(x,y)向量.…
http://acm.hdu.edu.cn/showproblem.php?pid=1392 题目大意: 二维平面给定n个点,用一条最短的绳子将所有的点都围在里面,求绳子的长度. 解题思路: 凸包的模板.凸包有很多的算法.这里用Adrew. 注意这几组测试数据 1 1 1 3 0 0 1 0 2 0 输出数据 0.00 2.00 #include<cmath> #include<cstdio> #include<algorithm> using namespace st…