想到一个 O(n^2 lg(n) ) 的解法: 1. sort on x axis, for the same x, sort on y both ascend-- O(nlg(n)) 2. for each pair (n1,n4) check d(n1,n4) == sqrt(2) L if yes, solve a linear equation, get the axis of other two nodes (n2,n3) of the sqare with (n1,n4) as diagonal nodes check the existences of (n2,n3) in sorted list