Run ID:57460
提交时间:2023-09-03 14:20:33
n=int(input()) arr=[] for x in map(int,input().split()): arr.append(x) m=int(input()) t=[] for i in range (m): a,b=map(int,input().split()) tmp=[] tmp.append(a) tmp.append(b) t.append(tmp) for i in t: count=0 for j in range (i[0]-1,i[1]): count+=arr[j] print(count)