Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.027 s | 3 KBi |
#2 |
Correcto
|
0.027 s | 3 KBi |
#3 |
Correcto
|
0.03 s | 3 KBi |
#4 |
Correcto
|
0.024 s | 3 KBi |
#5 |
Correcto
|
0.029 s | 3 KBi |
#6 |
Correcto
|
0.03 s | 3 KBi |
#7 |
Correcto
|
0.026 s | 3 KBi |
#8 |
Correcto
|
0.123 s | 4 KBi |
#9 |
Correcto
|
0.57 s | 9 KBi |
#10 |
Correcto
|
0.573 s | 9 KBi |
#11 |
Correcto
|
0.463 s | 9 KBi |
#12 |
Correcto
|
0.509 s | 9 KBi |
#13 |
Correcto
|
0.561 s | 9 KBi |
#14 |
Correcto
|
0.506 s | 9 KBi |
n = int(input()) a = [int(x) for x in input().split()] ps = [0] for i in range(len(a)): ps.append(a[i] + ps[i]) ps.append(ps[len(ps) - 1]) q = int(input()) for _ in range(q): l, r = [int(x) for x in input().split()] print(ps[r + 1] - ps[l])