POJ 2074 Line of Sight
来源:互联网 发布:退出mysql命令行 编辑:程序博客网 时间:2024/06/05 14:26
Line of Sight
Time Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1406 Accepted: 423
Description
An architect is very proud of his new home and wants to be sure it can be seen by people passing by his property line along the street. The property contains various trees, shrubs, hedges, and other obstructions that may block the view. For the purpose of this problem, model the house, property line, and obstructions as straight lines parallel to the x axis:
To satisfy the architect's need to know how visible the house is, you must write a program that accepts as input the locations of the house, property line, and surrounding obstructions and calculates the longest continuous portion of the property line from which the entire house can be seen, with no part blocked by any obstruction.
To satisfy the architect's need to know how visible the house is, you must write a program that accepts as input the locations of the house, property line, and surrounding obstructions and calculates the longest continuous portion of the property line from which the entire house can be seen, with no part blocked by any obstruction.
Input
Because each object is a line, it is represented in the input file with a left and right x coordinate followed by a single y coordinate:
< x1 > < x2 > < y >
Where x1, x2, and y are non-negative real numbers. x1 < x2
An input file can describe the architecture and landscape of multiple houses. For each house, the first line will have the coordinates of the house. The second line will contain the coordinates of the property line. The third line will have a single integer that represents the number of obstructions, and the following lines will have the coordinates of the obstructions, one per line.
Following the final house, a line "0 0 0" will end the file.
For each house, the house will be above the property line (house y > property line y). No obstruction will overlap with the house or property line, e.g. if obstacle y = house y, you are guaranteed the entire range obstacle[x1, x2] does not intersect with house[x1, x2].
< x1 > < x2 > < y >
Where x1, x2, and y are non-negative real numbers. x1 < x2
An input file can describe the architecture and landscape of multiple houses. For each house, the first line will have the coordinates of the house. The second line will contain the coordinates of the property line. The third line will have a single integer that represents the number of obstructions, and the following lines will have the coordinates of the obstructions, one per line.
Following the final house, a line "0 0 0" will end the file.
For each house, the house will be above the property line (house y > property line y). No obstruction will overlap with the house or property line, e.g. if obstacle y = house y, you are guaranteed the entire range obstacle[x1, x2] does not intersect with house[x1, x2].
Output
For each house, your program should print a line containing the length of the longest continuous segment of the property line from which the entire house can be to a precision of 2 decimal places. If there is no section of the property line where the entire house can be seen, print "No View".
Sample Input
2 6 60 15 031 2 13 4 112 13 11 5 50 10 010 15 10 0 0
Sample Output
8.80No View
Source
Mid-Atlantic 2004
- POJ 2074 Line of Sight
- poj 2074 Line of Sight
- Poj 2074 Line of Sight
- POJ 2074 Line of Sight
- POJ 2074 Line of Sight
- poj 2074 Line of Sight
- POJ 2074 Line of Sight
- poj 2074Line of Sight
- poj 2074 Line of Sight
- POJ 2074 Line of Sight(求交点)
- POJ 2074 Line of Sight 直线交
- Line of Sight - POJ 2074 直线交点
- POJ 2074 Line of Sight <几何>
- POJ 2074 Line of Sight(判线段与直线相交)
- poj 2074 Line of Sight(计算几何)
- POJ 2074 Line of Sight 直线相交+线段覆盖
- poj2074 Line of Sight
- Poj.2074 Line of Sight【计算几何-线段】 2015/08/28
- 论文下载点整理
- 看看程序员是怎么读简历的(图)
- JQuery each迭代Table中某列值
- Bash Arrays
- Web.config文件例子详解
- POJ 2074 Line of Sight
- 对初学单片机的同学们的几点建议
- GDI与DX截屏API操作
- 谁知道如下这样报表是用水晶报表做的吗,如不是水晶报表做的,又是如何做的呢,
- 用Visual C#创建Windows服务程序
- 获取本机公网上的IP地址(借助发布在公网上的IP查询网站)
- 人力大量输出:中国距劳动力短缺时代还有多远?
- 提高EQ
- C++ 学习(一)类型转换