这里。 我试图用二分答案+单调栈+大量的模拟和数学解决这题,时间复杂度为 O(nm log2hmax)O(nm\ \mathrm{log_2h_{max}})O(nm log2hmax)(附带巨大常数)。然而做到一半不会了。