|
||||||||||
Counting IntersectionsTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2020 Accepted Submission(s): 637 Problem Description Given some segments which are paralleled to the coordinate axis. You need to count the number of their intersection. The input data guarantee that no two segments share the same endpoint, no covered segments, and no segments with length 0. Input The first line contains an integer T, indicates the number of test case. The first line of each test case contains a number n(1<=n<=100000), the number of segments. Next n lines, each with for integers, x1, y1, x2, y2, means the two endpoints of a segment. The absolute value of the coordinate is no larger than 1e9. Output For each test case, output one line, the number of intersection. Sample Input
Sample Output
Author BUPT Source | ||||||||||
|