Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.021 s | 3 KBi |
#2 |
Correcto
|
0.021 s | 3 KBi |
#3 |
Correcto
|
0.025 s | 3 KBi |
#4 |
Correcto
|
0.023 s | 3 KBi |
#5 |
Correcto
|
0.02 s | 3 KBi |
#6 |
Correcto
|
0.022 s | 3 KBi |
#7 |
Correcto
|
0.021 s | 3 KBi |
#8 |
Correcto
|
0.096 s | 5 KBi |
#9 |
Correcto
|
0.382 s | 13 KBi |
#10 |
Correcto
|
0.308 s | 13 KBi |
#11 |
Correcto
|
0.251 s | 13 KBi |
#12 |
Correcto
|
0.249 s | 13 KBi |
#13 |
Correcto
|
0.429 s | 13 KBi |
#14 |
Correcto
|
0.272 s | 13 KBi |
lg = int(input()) arr = [] numbs = input() numbs2 = numbs.split() for i in range(len(numbs2)): num = int(numbs2[i]) arr.append(num) suma = [] add = 0 for i in range(lg): add += arr[i] suma.append(add) pruebas = int(input()) final = [] for j in range(pruebas): casoNum = input() pq = casoNum.split() p = int(pq[0]) q = int(pq[1]) if p > 0: final.append(suma[q] - suma[p - 1]) else: final.append(suma[q]) for i in range(len(final)): print(final[i])