Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.026 s | 3 KBi |
#2 |
Correcto
|
0.018 s | 3 KBi |
#3 |
Correcto
|
0.019 s | 3 KBi |
#4 |
Correcto
|
0.021 s | 3 KBi |
#5 |
Correcto
|
0.019 s | 3 KBi |
#6 |
Correcto
|
0.017 s | 3 KBi |
#7 |
Correcto
|
0.016 s | 3 KBi |
#8 |
Correcto
|
0.076 s | 4 KBi |
#9 |
Correcto
|
0.236 s | 9 KBi |
#10 |
Correcto
|
0.212 s | 8 KBi |
#11 |
Correcto
|
0.278 s | 9 KBi |
#12 |
Correcto
|
0.256 s | 8 KBi |
#13 |
Correcto
|
0.254 s | 8 KBi |
#14 |
Correcto
|
0.257 s | 8 KBi |
n = input() input_array = input() array = [int(x) for x in input_array.split()] n = int(n) for i in range(1, n): array[i] = array[i] + array[i-1] c = input() c = int(c) outputs = [] for i in range(0, c): response = 0 input_pq = input() pq = [int(r) for r in input_pq.split()] p, q = pq[0], pq[1] if p == 0: response = array[q] else: response = array[q] - array[p-1] outputs.append(response) for k in range(0, c): print(outputs[k])