Segments
| Time Limit: 1000MS | Memory Limit: 65536K | |
| Total Submissions: 19350 | Accepted: 6082 |
Description
Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least one point in common.
Input
Input begins with a number T showing the number of test cases and then, T test cases follow. Each test case begins with a line containing a positive integer n ≤ 100 showing the number of segments. After that, n lines containing four real numbers x1 y1 x2

探讨如何通过检查线段端点构成的直线,来判断是否存在一条直线,使所有线段投影到此直线后至少有一点重合。利用数学运算和几何原理,实现算法并附带代码示例。
最低0.47元/天 解锁文章
305

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



