-->
当前位置:首页 > 题库

PROGRAMMING:Distressed WLS

Luz5年前 (2021-05-10)题库395
WLS encountered a problem, there is a length of n (n $$< $$100000) array and the total number of queries m (M $$< $$100000), every time you ask, you have to answer the sum of all the numbers in this range, WLS camp has been very tired, so he handed this problem to you.
###Input format:
Two numbers n, m in the first line
The next line has n numbers A1, A2, A3... An
Then I asked m times
Give L, R every time (1 < = l < = R < = n)
###Output format:
Each query output interval sum of all numbers
###Input example:
```in
5 3
1 2 3 4 5
1 5
2 4
3 3
```
###Output example:
```out
fifteen
nine
three
```







answer:If there is no answer, please comment