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

建议使用的浏览器:

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

1720:SQUARES

题目描述
We are given N squares in the coordinate plane whose sides are parallel to the coordinate axes. All the corners have integer coordinates and the squares do not touch or overlap.
You are required to count the number of squares visible from the origin point O, O = (0, 0).
A square is visible from the origin point O if there are two distinct points A and B on one of its sides such that the interior of the triangle OAB has no common points with any of the remaining squares.
输入解释
The first line of the input contains the integer N, 1 <= N <= 1000, the number of squares.
Each of the following N lines describes a square by specifying integers X, Y and L separated by single blank characters, 1 <= X, Y, L <= 10000. X and Y are coordinates of the lower left corner (the corner with the least X and Y coordinates) and L is the side length.
输出解释
The first and the only line of the output should contain the number of squares that are visible from the origin.
输入样例
3
2 6 3
1 4 1
3 4 1
输出样例
3

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

题目来源 CEOI 1998

源链接: POJ-1720

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

共提交 0

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