CF933C.A Colourful Prospect

省选/NOI-

通过率:0%

时间限制:1.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Firecrackers scare Nian the monster, but they're wayyyyy too noisy! Maybe fireworks make a nice complement.

Little Tommy is watching a firework show. As circular shapes spread across the sky, a splendid view unfolds on the night of Lunar New Year's eve.

A wonder strikes Tommy. How many regions are formed by the circles on the sky? We consider the sky as a flat plane. A region is a connected part of the plane with positive area, whose bound consists of parts of bounds of the circles and is a curve or several curves without self-intersections, and that does not contain any curve other than its boundaries. Note that exactly one of the regions extends infinitely.

鞭炮能吓跑年兽,但它们实在太吵啦!或许烟花可以作为不错的补充。

小汤米正在观看一场烟花表演。当一个个圆形图案在夜空中扩散开来时,农历除夕之夜呈现出一幅壮丽的景象。

一个奇妙的问题突然闪现在汤米脑海中:这些圆在天空(即平面)上一共划分出了多少个区域?我们把天空视为一个平面。所谓“区域”,是指平面上具有正面积的一个连通部分,其边界由若干圆的边界弧段组成,且该边界是一条或若干条无自交的曲线;此外,该区域内部不包含除自身边界外的任何其他曲线。注意:恰好有一个区域是无限延伸的。

输入格式

The first line of input contains one integer n (1 ≤ n ≤ 3), denoting the number of circles.

The following n lines each contains three space-separated integers x, y and r ( - 10 ≤ x, y ≤ 10, 1 ≤ r ≤ 10), describing a circle whose center is (x, y) and the radius is r. No two circles have the same x, y and r at the same time.

输入的第一行包含一个整数 nn(1≤n≤31 \leq n \leq 3),表示圆的个数。

接下来的 nn 行,每行包含三个用空格分隔的整数 xx、yy 和 rr(−10≤x,y≤10-10 \leq x, y \leq 10,1≤r≤101 \leq r \leq 10),描述一个圆心为 (x,y)(x, y)、半径为 rr 的圆。任意两个圆不会同时具有相同的 xx、yy 和 rr。

输出格式

Print a single integer — the number of regions on the plane.

输出一个整数——平面上的区域数量。

输入输出样例

  • 输入#1

    3
    0 0 1
    2 0 1
    4 0 1

    输出#1

    4
  • 输入#2

    3
    0 0 2
    3 0 2
    6 0 2

    输出#2

    6
  • 输入#3

    3
    0 0 2
    2 0 2
    1 1 2

    输出#3

    8

说明/提示

For the first example,

For the second example,

For the third example,

对于第一个例子,

对于第二个例子,

对于第三个例子,

输入解题思路,AI测评打分。不知道怎么写?

首页