Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Non-decreasing Sequence

Revision en1, by AdarshBhaiyaNeICPCPela, 2019-08-05 01:46:46

Given an array of $$$n$$$ integers, with $$$1 \le a_i \le 10^6$$$, and given queries of type $$$(l, r)$$$, find whether, if we delete all the elements of the array such that $$$l \le a_i \le r$$$, the resultant array will form a non-decreasing sequence. We need to answer these queries in $$$O(1)$$$ time complexity.

How to do this problem?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English AdarshBhaiyaNeICPCPela 2019-08-05 01:46:46 346 Initial revision (published)