kd-tree倒是可以写 O(nsqrtn) 但我感觉笔试应该没这么复杂?