luogu#P2632. Explorer
Explorer
Background
Hint: The testdata for this problem is relatively weak; passing this problem does not guarantee that your program or approach is entirely correct.
Problem Description
Given two straight lines with points on them respectively, find the minimum spanning tree formed by these points.
Input Format
The input consists of lines.
- The first line contains and .
- The second line contains four integers .
- The third line contains four integers .
- The fourth line contains real numbers, representing points on the first line. For a point, a real number indicates that the coordinates of the point are .
- The fifth line contains real numbers, representing points on the second line, in the same manner as above.
Output Format
Output a single real number on one line: the length of the minimum spanning tree, rounded to three decimal places.
4 4
0 0 10 10
0 10 10 0
0.1 0.3 0.6 0.8
0.1 0.3 0.6 0.8
19.638
Hint
Constraints: , and the absolute values of are all less than or equal to . .
2024/2/8: Added one hack testdata.
Translated by ChatGPT 5