Given an array A of length n and a 2D array B which consists of m queries.
Each query is one of the following two types:
• Type 1- L R 0: Find the number of non-decreasing subarrays in the range from L to R.
• Type 2 - L R X: Replace every element in the range from L to R with X where X != 0.
Find the sum of answers to queries of Type 1
Comments (7)


