Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.026 s | 3 KBi |
#2 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 39, in <module> adition_a = array[i] IndexError: list index out of range |
0.026 s | 3 KBi |
#3 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 39, in <module> adition_a = array[i] IndexError: list index out of range |
0.025 s | 3 KBi |
#4 |
Correcto
|
0.024 s | 4 KBi |
#5 |
Correcto
|
0.022 s | 3 KBi |
#6 |
Incorrecto
|
0.026 s | 3 KBi |
#7 |
Correcto
|
0.024 s | 3 KBi |
#8 |
Correcto
|
0.086 s | 5 KBi |
#9 |
Correcto
|
0.281 s | 13 KBi |
#10 |
Correcto
|
0.304 s | 13 KBi |
#11 |
Correcto
|
0.288 s | 13 KBi |
#12 |
Correcto
|
0.279 s | 13 KBi |
#13 |
Correcto
|
0.313 s | 18 KBi |
#14 |
Correcto
|
0.344 s | 15 KBi |
n = input() size = int(n) array = size *[0] total_a = size *[0] adition_a = 0 number = input() args = number.split() c = input() query_number = int(c) p = query_number *[0] q = query_number *[0] for i in range (0,size): array[i] = int(args[i]) for i in range(0,query_number): query_pq= input() token = query_pq.split() p[i]=int(token[0]) q[i]=int(token[1]) adition = 0 for i in range(0,size): adition = adition + array[i] total_a[i] = adition i =0 for i in range(0,query_number): adition_a = 0 if int(p[i])== 0: adition_a = total_a[q[i]] if int(p[i]) == q[i]: adition_a = array[i] if int(q[i]) > int(p[i]) and int(p[i])!= 0: adition_a = total_a[q[i]] - total_a[p[i]-1] print(adition_a)