Intersection
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 17761 | Accepted: 4556 |
Description
You are to write a program that has to decide whether a given line segment intersects a given rectangle.
An example:
line: start point: (4,9)
end point: (11,2)
rectangle: left-top: (1,5)
right-bottom: (7,1)
Figure 1: Line segment does not intersect rectangle
The line is said to intersect the rectangle if the line and the rectangle have at least one point in common. The rectangle consists of four straight lines and the

该博客讨论的是如何判断一条线段是否与一个矩形相交的问题,其中矩形是实心的,线段在矩形内也视为相交。题目来自Southwestern European Regional Contest 1995。博客提到了判断过程中的注意事项,包括处理矩形点的输入顺序,并提供了相应的解决方案。
最低0.47元/天 解锁文章
529

被折叠的 条评论
为什么被折叠?



