Help needed to solve this problem!!
Разница между en1 и en2, 29 символ(ов) изменены
You Are given an array **A** of **N** integers.↵
You have to answer **Q** queries of form **L R**.↵
Answer to each query is sum of lengths of all sub arrays in **A** whose maximum element lies in range [L,R].↵

**Constraints:**↵

1<=N,Q<=3*10^5
 
1<=A[i]<=10^9↵
1<=L<=R<=10^9↵

**Input:**↵
`
5 3↵
`↵
`↵
1 2 3 4 5↵
1 3↵
1 5
`↵
`↵
1 3↵
`↵
`↵
1 5↵
`↵
`

5 5↵
`↵

**Output:**↵

10↵
35↵
15

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский aya1909 2020-10-05 18:28:35 29
en1 Английский aya1909 2020-10-05 18:26:16 387 Initial revision (published)