最大的区间值(区间值:区间和*区间最小)

对于数组中的每个数,用单调栈去求它左、右两边分别大于它的数的位置,比如分别在 i 和 j 。

那么在开区间(i , j )中,这个数是最小的。

ans = min(sum(i + 1, j - 1) * num[index]) --> (0 <= index < n)

猜你喜欢

转载自www.cnblogs.com/liqiniuniu/p/10530816.html