当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3025:Rings

题目描述
Little John is in big trouble. Playing with his different-sized (and colored!) rings and glue seemed such a good idea... However, the rings now lay on the floor, glued together with something that will definitely not come off with water. Surprisingly enough, it seems like no rings are actually glued to the floor, only to other rings. How about that!

You must help Little John to pick the rings off the floor before his mom comes home from work. Since the glue is dry by now, it seems like an easy enough task. This is not the case. Little John is an irrational kid of numbers, and so he has decided to pick up the largest component (most rings) of glued-together rings first. It is the number of rings in this largest component you are asked to find. Two rings are glued together if and only if they overlap at some point but
no rings will ever overlap in only a single point. All rings are of the doughnut kind (with a hole in them). They can however, according to Little John, be considered “infinitely thin”.
输入解释
Input consists of a number ( > 0) of problems. Each problem starts with the number of rings, n, where 0 ≤ n <= 100. After that, n rows follow, each containing a rings' physical attributes. That is, 3 floating point numbers, with an arbitraty number of spaces between them, describing the x coordinate and y coordinate for it's center and it's radius. All floating point numbers fit into the standard floating point type of your favorite programming language (e.g, float for C/C++). Input ends with a single row with the integer -1.
输出解释
Output consists of as many answers as there were problems, each answer, on a separate line, being ‘The largest component contains X rings’ where X is the number of rings in the largest component.
输入样例
4
0.0 0.0 1.0
-1.5 -1.5 0.5
1.5 1.5 0.5
-2.0 2.0 3.5
3
3.0 2.0 2.0
0.0 -0.5 1.0
0.0 0.0 2.0
5
-2.0 0.0 1.0
1.0 -1.0 1.0
0.0 1.0 0.5
2.0 0.0 1.0
-1.0 1.0 1.0
-1
输出样例
The largest component contains 4 rings
The largest component contains 2 rings
The largest component contains 3 rings

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3025

最后修改于 2020-10-29T06:50:28+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536