Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.025 s | 3 KBi |
#2 |
Correcto
|
0.032 s | 3 KBi |
#3 |
Correcto
|
0.045 s | 7 KBi |
#4 |
Correcto
|
0.031 s | 3 KBi |
#5 |
Correcto
|
0.032 s | 3 KBi |
#6 |
Correcto
|
0.031 s | 3 KBi |
#7 |
Correcto
|
0.029 s | 3 KBi |
#8 |
Correcto
|
0.101 s | 4 KBi |
#9 |
Correcto
|
0.479 s | 8 KBi |
#10 |
Correcto
|
0.465 s | 9 KBi |
#11 |
Correcto
|
0.423 s | 9 KBi |
#12 |
Correcto
|
0.463 s | 9 KBi |
#13 |
Correcto
|
0.469 s | 10 KBi |
#14 |
Correcto
|
0.53 s | 9 KBi |
n = int(input()) nums = list(map(int, input().split())) acum = [0 for x in range(n)] acum[0] = nums[0] for i in range(1, n): acum[i] = acum[i - 1] + nums[i] c = int(input()) for _ in range(c): p, q = map(int, input().split()) if p == 0: print(acum[q]) else: print(acum[q] - acum[p - 1])