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

AdarshBhaiyaNeICPCPela's blog

By AdarshBhaiyaNeICPCPela, history, 7 years ago, In English

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?

Full text and comments »