My Approach 
Answer is no if there exist $i < j$ in range asked 18 Aug '18, 04:27

what is your approach?? how you have used segment tree? i think solution possible without segment tree . answered 18 Aug '18, 10:42
I'm using segment tree. But I have not inserted 0 in tree. Instead using INF. And for given range l,r. I'm returning smallest no in this range. And using condition @vishesh345 's answer.
(18 Aug '18, 12:02)

Thank you friends. I have got AC on 33rd submission xD. I just removed one linear loop for inserting q by using some more variables. And removed handling of special case of 1. answered 18 Aug '18, 12:03
