Segment Tree Problem

Revision en2, by ZeyadKhattab, 2019-01-01 20:54:38

How can we solve the following problem efficiently (I am mainly looking for a Segment Tree solution) ? Given an array of integers A of size N , and Q queries of the form L,R,X we need to find the minimum index i such that L<=i<=R and A[i]>=X 1<=L<=R<=N and |X|<=10^9 1<=N<=10^5 1<=Q<=10^5 |A[i]|<=10^9 for 1<=i<=N

Tags #segment tree


  Rev. Lang. By When Δ Comment
en2 English ZeyadKhattab 2019-01-01 20:54:38 328 Tiny change: 'or 1<=i<=N' -> 'or 1<=i<=N\n' (published)
en1 English ZeyadKhattab 2019-01-01 20:39:41 95 Initial revision (saved to drafts)