Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.032 s | 3 KBi |
#2 |
Correcto
|
0.027 s | 3 KBi |
#3 |
Correcto
|
0.033 s | 3 KBi |
#4 |
Correcto
|
0.034 s | 3 KBi |
#5 |
Correcto
|
0.029 s | 3 KBi |
#6 |
Correcto
|
0.036 s | 3 KBi |
#7 |
Correcto
|
0.033 s | 3 KBi |
#8 |
Correcto
|
0.189 s | 4 KBi |
#9 |
Correcto
|
0.842 s | 9 KBi |
#10 |
Correcto
|
0.465 s | 9 KBi |
#11 |
Correcto
|
0.794 s | 9 KBi |
#12 |
Correcto
|
0.776 s | 9 KBi |
#13 |
Correcto
|
0.882 s | 9 KBi |
#14 |
Correcto
|
0.842 s | 9 KBi |
n = int(input()) v = list(map(int, input().split())) acc = [v[0]] for i in range(1, len(v)): acc.append(acc[i - 1] + v[i]) q = int(input()) for _ in range(q): l, r = map(int, input().split()) cur = 0 if l != 0: cur = acc[l - 1] print(acc[r] - cur)