Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.02 s | 3 KBi |
#2 |
Correcto
|
0.02 s | 3 KBi |
#3 |
Correcto
|
0.023 s | 4 KBi |
#4 |
Correcto
|
0.022 s | 3 KBi |
#5 |
Correcto
|
0.023 s | 3 KBi |
#6 |
Correcto
|
0.024 s | 3 KBi |
#7 |
Correcto
|
0.022 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(idx) NameError: name 'idx' is not defined |
0.021 s | 3 KBi |
#9 |
Correcto
|
0.027 s | 3 KBi |
#10 |
Correcto
|
0.02 s | 3 KBi |
#11 |
Correcto
|
0.026 s | 3 KBi |
#12 |
Incorrecto
|
0.022 s | 3 KBi |
#13 |
Incorrecto
|
0.024 s | 3 KBi |
#14 |
Incorrecto
|
0.304 s | 32 KBi |
#15 |
Correcto
|
0.266 s | 12 KBi |
#16 |
Correcto
|
0.265 s | 33 KBi |
#17 |
Correcto
|
0.259 s | 29 KBi |
#18 |
Correcto
|
0.293 s | 29 KBi |
#19 |
Correcto
|
0.28 s | 29 KBi |
#20 |
Incorrecto
|
0.339 s | 57 KBi |
nNumbers = int(input()) numbers = list(map(int, input().rsplit(" "))) assert nNumbers == len(numbers), "Different lengths." control = 0 left = 0 right = 0 i = nNumbers - 1 for number in numbers[::-1]: control += number if control < 0: right += number idx = i else: left += number i -= 1 if left < 1: idx = "Impossible" print(idx)