Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.033 s | 3 KBi |
#2 |
Correcto
|
0.039 s | 7 KBi |
#3 |
Correcto
|
0.03 s | 3 KBi |
#4 |
Correcto
|
0.032 s | 3 KBi |
#5 |
Correcto
|
0.026 s | 3 KBi |
#6 |
Correcto
|
0.034 s | 4 KBi |
#7 |
Correcto
|
0.042 s | 5 KBi |
#8 |
Correcto
|
0.034 s | 4 KBi |
#9 |
Correcto
|
0.04 s | 7 KBi |
#10 |
Correcto
|
0.029 s | 3 KBi |
#11 |
Correcto
|
0.038 s | 7 KBi |
#12 |
Correcto
|
0.034 s | 7 KBi |
#13 |
Correcto
|
0.033 s | 3 KBi |
#14 |
Correcto
|
0.245 s | 45 KBi |
#15 |
Correcto
|
0.409 s | 30 KBi |
#16 |
Correcto
|
0.302 s | 33 KBi |
#17 |
Correcto
|
0.353 s | 31 KBi |
#18 |
Correcto
|
0.204 s | 29 KBi |
#19 |
Correcto
|
0.334 s | 31 KBi |
#20 |
Correcto
|
0.384 s | 60 KBi |
import itertools as it n_arr = int(input()) arr = map(int, input().split(' ')) psums = list(it.accumulate(arr)) S = psums[-1] for n, s in enumerate(psums[:-1]): l = s r = S - l if l > 0 and r < 0: print(n+1) break else: print('Impossible')