Help needed in a query based problem

Правка en1, от Lakh, 2018-05-18 10:34:14

Given an array A of N elements. Here A[i] denotes the height of ith plant. There are Q queries of 3 types: 1. CUT h: Here for all plants with height greater than h ,cut them to height h. 2. GROW i x: Increase the height of ith plant by x. 3. MAGIC y: Increase the height of all plants by y.

For each query of type 1 , we have to print the total length of plants that is to be cut . Please suggest some approach to solve this problem.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Lakh 2018-05-18 10:59:48 55
en1 Английский Lakh 2018-05-18 10:34:14 477 Initial revision (published)