Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.023 s | 3 KBi |
#2 |
Correcto
|
0.028 s | 3 KBi |
#3 |
Correcto
|
0.026 s | 3 KBi |
#4 |
Correcto
|
0.026 s | 3 KBi |
#5 |
Correcto
|
0.024 s | 3 KBi |
#6 |
Correcto
|
0.027 s | 3 KBi |
#7 |
Correcto
|
0.025 s | 3 KBi |
#8 |
Correcto
|
0.141 s | 4 KBi |
#9 |
Correcto
|
0.605 s | 9 KBi |
#10 |
Tiempo límite excedido
|
0.637 s | 9 KBi |
#11 |
Correcto
|
0.828 s | 9 KBi |
#12 |
Tiempo límite excedido
|
0.741 s | 9 KBi |
#13 |
Correcto
|
0.584 s | 9 KBi |
#14 |
Correcto
|
0.591 s | 9 KBi |
n = int(input()) array = list(map(int, input().split())) cases = int(input()) total = 0 for i in range(n): total+=array[i] array[i] = total for _ in range(cases): p, q = list(map(int, input().split())) if p == 0: print(array[q]) else: print(array[q] - array[p-1])