poj2932 Coneology (扫描线)】的更多相关文章

转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3289   Accepted: 586 Description A student named Round Square loved to play with cones. He would arrange cones with diff…
POJ2932 Coneology 题意: 给出一些不相交的圆,问有多少个圆不被其他圆包围 题解: 扫描线,把所有圆的左边界和右边界放到\(vector\)里排序,遍历到圆左边界的时候判断是否满足条件,到右边界的时候把这个圆从\(set\)中删掉,对于一个选到当前左边界的圆,因为不存在相交,所以只需要判断与他\(y\)坐标最近的两个在\(set\)中的圆是否包含他即可 #include<cstdio> #include<cstring> #include<iostream&g…
题意:有n个圆 依次给了半径和圆心坐标  保证输入的圆不相交(只有 相离 和 内含/外含 的情况)   问 有几个圆 不内含在其他圆中,并分别列出这几个圆的编号(1~n) (n的范围是[1, 40000]) 案例画出来大概是这样的 (那个原点为(50,50)的太远了,就意思一下) 所以答案是3号圆和5号圆 不被包含 好了,若这道题n只有1000,那么只要for两层,每个圆与另外的圆比较, 判断圆心是否在其他圆内即可判断是否包含 这样的复杂度是O($n^2$) 可是现在n有40000,显然不能用O…
Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4097   Accepted: 859 Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbitrarily on the floor and would admire…
地址:http://poj.org/problem?id=2932 题目: Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4170   Accepted: 886 Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbi…
题目: Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbitrarily on the floor and would admire the intrinsic beauty of the arrangement. The student even began theorizing about how som…
Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 3574   Accepted: 680 Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbitrarily on the floor and would admire…
题意 平面上有N个两两不相交的圆,求全部最外层的,即不被其它圆包括的圆的个数并输出 思路 挑战程序竞赛P259页 代码 /* ********************************************** Auther: xueaohui Created Time: 2015-7-25 16:56:13 File Name : poj2932.cpp *********************************************** */ #include <iostr…
[题目链接] http://poj.org/problem?id=2932 [题目大意] 给出N个两两没有公共点的圆,求所有不包含于其它圆内部的圆 [题解] 我们计算出所有点在圆心所有y位置的x值, 由于两两没有公共点,所以当我们对所有的x坐标进行扫描时,只要扫描相邻的x, 判定扫描到的圆和与其x相邻的圆是否是圆包含关系就可以判断一个圆的位置 扫描到左端点时,如果圆其被包含,则什么都不做,否则,将这个圆加入set中, 当扫描到右端点时,如果圆被包含,则什么都不做,否则将圆从set中去除. [代码…
原题如下: Coneology Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4937   Accepted: 1086 Description A student named Round Square loved to play with cones. He would arrange cones with different base radii arbitrarily on the floor and would…