def binary_search(arr, target): left, right = 0, len(arr) while left < right: mid = (left + right) // 2 if arr[mid] >= target: right = mid else: left = mid + 1 return left def solve(n, heights): # 计算最长上升子序列(LIS) inc = [1] * n...