Can any any data structure solve this problem ?

Revision en1, by I_love_Saundarya, 2019-08-28 07:59:02

The problem is as follows(created by me) : -

Given an array of 'n' integers , where n=10^6 , all integers are non-negative.

There are 10^5 queries of the the type :- Q(L,R,X) , which means the first index of a number whose value is less than or equal to x .

Example :- {2,3,4,5,2,1} and Q(2,6,2) = 5 , as a[5]=2 which is <=2 .

Is there any way to solve it ?

Tags #advance data structures, #segment tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English I_love_Saundarya 2019-08-28 07:59:02 417 Initial revision (published)