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

来源:互联网 发布:js截取字符串中的汉字 编辑:程序博客网 时间:2024/05/01 19:43

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

Description

Download as PDF

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.

\epsfbox{p2572.eps}

Input

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


n  x1y1r1x2y2r2$ \vdots$  xnynrn


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 $ \pm$x 10-13 . That is, it is guaranteed that variations of less than $ \pm$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

30 0 0.5-0.9 0 1.000000000010.9 0 1.0000000000150 1 0.51 1 1.000000000010 2 1.00000000001-1 1 1.000000000010 -0.00001 1.0000000000150 1 0.51 1 1.000000000010 2 1.00000000001-1 1 1.000000000010 0 1.0000000000120 0 1.00000010 0 120 0 10.00000001 0 10

Sample Output

3542



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

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


0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 羊水破了一直流怎么办 孕38周羊水破了怎么办 羊水破了没阵痛怎么办 孕37周羊水破了怎么办 孕晚期羊水偏多怎么办 怀孕30周羊水少怎么办 怀孕30周羊水多怎么办 孕30周羊水少怎么办 拔完智齿嗓子疼怎么办 神经功能性引起的胸闷怎么办 中风后说话不清怎么办 老人吃不进去饭怎么办 老人吃什么就吐怎么办 老人吃了就吐怎么办 老人吃饭噎着了怎么办 胃胀气嗝不出来怎么办 嗓子咽口水都疼怎么办 产后盆底肌肉松弛怎么办 2个月宝宝鼻塞怎么办 人淹死捞不上来怎么办 胶囊卡在胃里怎么办 药卡在气管里怎么办 胶囊药卡在气管怎么办 被胶囊卡在喉咙怎么办 药卡在食道里怎么办 胶囊黏在喉咙里怎么办 要一直卡在喉咙怎么办 胃老是往上反气怎么办 有口气憋在喉咙怎么办 肛裂伤口不愈合怎么办 肛裂口子不愈合怎么办 宝宝胃食道反流怎么办 去角质后脸发红怎么办 红烧肉做的太甜怎么办 红烧排骨太甜了怎么办 唱歌时嗓子有痰怎么办 一唱歌喉咙有痰怎么办 鼻子老是打喷嚏还流鼻涕怎么办 鼻涕流到喉咙里怎么办 鼻塞怎么办怎样让鼻通气 流清鼻涕嗓子疼怎么办