Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.023 s | 3 KBi |
#2 |
Correcto
|
0.025 s | 3 KBi |
#3 |
Correcto
|
0.032 s | 6 KBi |
#4 |
Correcto
|
0.025 s | 3 KBi |
#5 |
Correcto
|
0.022 s | 3 KBi |
#6 |
Correcto
|
0.028 s | 3 KBi |
#7 |
Correcto
|
0.031 s | 3 KBi |
#8 |
Error en tiempo de ejecución (NZEC)
Exited with error status 1 Traceback (most recent call last): File "script.py", line 18, in <module> print(index) NameError: name 'index' is not defined |
0.024 s | 3 KBi |
#9 |
Correcto
|
0.024 s | 3 KBi |
#10 |
Correcto
|
0.034 s | 6 KBi |
#11 |
Correcto
|
0.027 s | 3 KBi |
#12 |
Incorrecto
|
0.032 s | 3 KBi |
#13 |
Incorrecto
|
0.025 s | 3 KBi |
#14 |
Incorrecto
|
0.351 s | 32 KBi |
#15 |
Correcto
|
0.352 s | 12 KBi |
#16 |
Correcto
|
0.29 s | 29 KBi |
#17 |
Correcto
|
0.333 s | 29 KBi |
#18 |
Correcto
|
0.316 s | 29 KBi |
#19 |
Correcto
|
0.295 s | 29 KBi |
#20 |
Incorrecto
|
0.406 s | 57 KBi |
nNumbers = int(input()) numbers = list(map(int, input().rsplit(" "))) assert nNumbers == len(numbers), "Different lengths." control = 0 left = 0 right = 0 idx = nNumbers - 1 for number in numbers[::-1]: control += number if control < 0: right += number index = idx else: left += number idx -= 1 if left < 1: index = "Impossible" print(index)