10258_VivaConfetti

2022-5-16 18:16| 发布者: Hocassian| 查看: 57| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504704414000-Problem List-采集的数据-后羿采集器.html

Pro.ID

10258

Title

Viva Confetti

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10258

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    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.

    输入

    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 line 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 +/- 5 x 10^(-13). That is, it is guaranteed that variations of less than +/- 5 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, x1 y1 r1 being the bottom one and xn yn rn the top one. You are observing from the top.

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

    输出

    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 line 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 +/- 5 x 10^(-13). That is, it is guaranteed that variations of less than +/- 5 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, x1 y1 r1 being the bottom one and xn yn rn 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
    2
    Source

    样例输入

    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

    样例输出

    3
    5
    4
    2
    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部