find length of longest subsection with all element less than k and q query
source link: http://codeforces.com/blog/entry/104071
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
find length of longest subsection with all element less than k and q query
Given an integer sequence consisting of N elements a1, a2, … , aN and Q queries, each query is an integer K.
Requirements: For each query, determine the longest consecutive subsequence on the sequence A such that all the elements of that subsequence are not greater than K.
N, Q <= 10^5
| a[i] |<= 10^9
| K | <= 10^9
For example:
-2 5 6 10 -5 0
explain
for K = -10 , there are no subsegments that satisfy
for K = 5 , have the segment [a1, a2] or [a5, a6]
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK