简体   繁体   中英

Range Minimum Query above a constant value

Given an array of n elements . Find minimum value of element in range [l...r] such that a[k]> p . ( l<=k<=r and p varies with each l and r).

Is there any solution that works in log(N)?

PS : I thought of a solution to find(k) number of elements that are less than <= p. And then find the k+1th element in range if the array is sorted.but I am stuck at point update operation for the persistent segment tree for finding the k+1 th element.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM