A11625 | A Colourful Prospect
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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.
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.
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.
输出格式
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,

For the second example,
For the third example,

C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted