Array range queries over range queries - GeeksforGeeks
Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands can be of the following two types of commands:
- Type 1 [l r (1 <= l <= r <= n)] : Increase all elements of the array by one, whose indices belongs to the range [l, r]. In these queries of the index is inclusive in the range.
- Type 2 [l r (1 <= l <= r <= m)] : Execute all the commands whose indices are in the range [l, r]. In these queries of the index is inclusive in the range. It's guaranteed that r is strictly less than the enumeration/number of the current command.
Read full article from Array range queries over range queries - GeeksforGeeks
No comments:
Post a Comment