码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-04-23 09:44:16      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:viva confetti   几何   la2572   圆盘问题   

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

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个圆盘,依次放到桌面的上。现按照放置的顺序,一次给出各个圆盘的圆心位置和半径,问最后有多少圆盘可见? 

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


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

标签:viva confetti   几何   la2572   圆盘问题   

原文地址:http://blog.csdn.net/u010579068/article/details/45201121

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!