complete at jungol 1077.py 3135.py 14020.py 3006.rs
This commit is contained in:
16
storage/jungol/py/completed/3135.py
Normal file
16
storage/jungol/py/completed/3135.py
Normal file
@@ -0,0 +1,16 @@
|
||||
import sys
|
||||
|
||||
input = sys.stdin.readline
|
||||
|
||||
if __name__ == "__main__":
|
||||
n = int(input())
|
||||
arr = list(map(int, input().split()))
|
||||
cum = [0] * (n + 1)
|
||||
|
||||
for i in range(1, n + 1):
|
||||
cum[i] = cum[i - 1] + arr[i - 1]
|
||||
|
||||
q = int(input())
|
||||
for _ in range(q):
|
||||
s, e = map(int, input().split())
|
||||
print(cum[e] - cum[s - 1])
|
||||
Reference in New Issue
Block a user