Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.02 s | 3 KBi |
#2 |
Correcto
|
0.021 s | 3 KBi |
#3 |
Correcto
|
0.02 s | 3 KBi |
#4 |
Correcto
|
0.021 s | 3 KBi |
#5 |
Correcto
|
0.024 s | 3 KBi |
#6 |
Correcto
|
0.026 s | 3 KBi |
#7 |
Correcto
|
0.023 s | 3 KBi |
#8 |
Correcto
|
0.112 s | 4 KBi |
#9 |
Correcto
|
0.485 s | 9 KBi |
#10 |
Correcto
|
0.512 s | 9 KBi |
#11 |
Correcto
|
0.449 s | 9 KBi |
#12 |
Correcto
|
0.414 s | 9 KBi |
#13 |
Correcto
|
0.471 s | 9 KBi |
#14 |
Correcto
|
0.487 s | 9 KBi |
import itertools n = input() arr = list(map(int, input().split(" "))) c = int(input()) acum = list(itertools.accumulate(arr)) for i in range(0, c): [p, q] = map(int, input().split()) print(acum[q] - (acum[p - 1] if p > 0 else 0))