Viva Confetti(几何+圆盘覆盖问题)

Viva Confetti

Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld
& %llu

Submit Status Practice UVALive
2572

Appoint description: 
System Crawler  (2015-04-19)

Description

Do you know confetti? They are small discs of colored paper, and people throw them around during parties or festivals. Since people throw lots of confetti, they may end up stacked one on another, so
there may be hidden ones underneath.

A handful of various sized confetti have been dropped on a table. Given their positions and sizes, can you tell us how many of them you can see?

The following figure represents the disc configuration for the first sample input, where the bottom disc is still visible.

Input

The input is composed of a number of configurations of the following form.

n    
x1 y1 r1
x2 y2 r2
   
xn yn rn

The first line in a configuration is the number of discs in the configuration (a positive integer not more than 100), followed by one Ine descriptions of each disc: coordinates of its center and radius, expressed as real numbers in decimal notation, with up
to 12 digits after the decimal point. The imprecision margin is x 10-13 . That
is, it is guaranteed that variations of less than x 10-13 on input values do
not change which discs are visible. Coordinates of all points contained in discs are between -10 and 10.

Confetti are listed in their stacking order, x1y1r1 being the bottom
one and xnynrn the top one. You are observing from the top.

The end of the input is marked by a zero on a single line.

Output

For each configuration you should output the number of visible confetti on a single line.

Sample Input

3
0 0 0.5
-0.9 0 1.00000000001
0.9 0 1.00000000001
5
0 1 0.5
1 1 1.00000000001
0 2 1.00000000001
-1 1 1.00000000001
0 -0.00001 1.00000000001
5
0 1 0.5
1 1 1.00000000001
0 2 1.00000000001
-1 1 1.00000000001
0 0 1.00000000001
2
0 0 1.0000001
0 0 1
2
0 0 1
0.00000001 0 1
0

Sample Output

3
5
4
2

题意:已知n个圆盘,依次放到桌面的上。现按照放置的顺序,一次给出各个圆盘的圆心位置和半径,问最后有多少圆盘可见?

【分析】:还没想好~~~~~~~容我思考一晚。

时间: 2024-08-14 03:34:47

Viva Confetti(几何+圆盘覆盖问题)的相关文章

uva 1308 - Viva Confetti(几何)

题目链接:uva 1308 - Viva Confetti 枚举一下两圆,处理出所有弧,然后判断每段弧的中点是否可见,可见的话该弧所在的圆也可见,以及该段弧下面的圆也可见. #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <algorithm> using namespace std; const double pi = 4 * at

ZOJ 1696 Viva Confetti 计算几何

计算几何:按顺序给n个圆覆盖,问最后可以有几个圆被看见... 对每个圆求和其他圆的交点,每两个交点之间就是可能被看到的圆弧,取圆弧的中点,往外扩展一点或者往里缩一点,从上往下判断有没有圆可以盖住这个点,能盖住这个点的最上面的圆一定是可见的 Viva Confetti Time Limit: 2 Seconds      Memory Limit: 65536 KB Do you know confetti? They are small discs of colored paper, and p

poj1418 Viva Confetti 判断圆是否可见

转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Viva Confetti Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 881   Accepted: 361 Description Do you know confetti? They are small discs of colored paper, and people throw them a

UVaLive2572 poj1418 UVa1308 Viva Confetti

一次放下n个圆 问最终可见的圆的数量 应该是比较经典的问题吧 考虑一个圆与其他每个圆的交点O(n)个 将其割成了O(n)条弧 那么看每条弧的中点 分别向内向外调动eps这个点 则最上面的覆盖这个点的圆可见O(n) 总时间复杂度O(n ** 3) 怕炸精度,代码基本抄的rjl的 1 #include<cstdio> 2 #include<cstring> 3 #include<cstdlib> 4 #include<algorithm> 5 #include&

简单几何(线段覆盖) POJ 3347 Kadj Squares

题目传送门 题意:告诉每个矩形的边长,它们是紧贴着的,问从上往下看,有几个还能看到. 分析:用网上猥琐的方法,将边长看成左端点到中心的距离,这样可以避免精度问题.然后先求出每个矩形的左右端点,然后如果被覆盖那么将端点更新到被覆盖的位置.最后看那些更新后左端点小于右端点,这些是可以看得到的. /************************************************ * Author :Running_Time * Created Time :2015/10/28 星期三

BZOJ 1043 下落的圆盘

Description 有n个圆盘从天而降,后面落下的可以盖住前面的.求最后形成的封闭区域的周长.看下面这副图, 所有的红色线条的总长度即为所求.  Input n ri xi y1 ... rn xn yn Output 最后的周长,保留三位小数 Sample Input 2 1 0 0 1 1 0 Sample Output 10.472 HINT 数据规模 n<=1000 这道题目很好嘴巴,但是写起来有点儿蛋疼. 首先求出每个圆盘被他上面的圆盘覆盖的圆心角的度数α,用(2π-α)*c/2π

挑战程序设计竞赛 3.6 与平面和空间打交道的计算几何

POJ 1981:Circle and Points /* 题目大意:给出平面上一些点,问一个半径为1的圆最多可以覆盖几个点 题解:我们对于每个点画半径为1的圆,那么在两圆交弧上的点所画的圆,一定可以覆盖这两个点 我们对于每个点计算出其和其它点的交弧,对这些交弧计算起末位置对于圆心的极角, 对这些我们进行扫描线操作,统计最大交集数量就是答案. */ #include <cstdio> #include <algorithm> #include <cmath> #incl

渲染管线

2.1为什么要介绍渲染管线? ??在微软DirectX10.0规范的统一渲染架构发布以前,渲染管线曾经是选购显卡的一项重要指标.然而采用流处理器渲染架构,由于硬件工作效率更高,目前已经逐渐取代了采用渲染管线的传统架构,在消费领域渲染管线的概念慢慢被淡化了.但是在计算机图形学领域,渲染管线却依然有着举足轻重的地位,因为它依然是实时渲染的基本原理.虽然在上一章提到了渲染管线这一概念,但并没有给出详细的解释,在这一章我要对渲染管线进行一个深入的分析. 2.2什么是渲染管线 ??渲染就是把3D场景转换到

POJ 1418 圆的基本操作以及 圆弧离散化

Viva Confetti Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 761   Accepted: 319 Description Do you know confetti? They are small discs of colored paper, and people throw them around during parties or festivals. Since people throw lots