Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Incorrecto
|
0.024 s | 3 KBi |
#2 |
Incorrecto
|
0.029 s | 3 KBi |
#3 |
Correcto
|
0.041 s | 5 KBi |
#4 |
Correcto
|
0.026 s | 3 KBi |
#5 |
Incorrecto
|
0.026 s | 3 KBi |
#6 |
Correcto
|
0.028 s | 3 KBi |
#7 |
Correcto
|
0.026 s | 3 KBi |
#8 |
Correcto
|
0.022 s | 3 KBi |
#9 |
Correcto
|
0.041 s | 5 KBi |
#10 |
Incorrecto
|
0.026 s | 3 KBi |
#11 |
Incorrecto
|
0.027 s | 3 KBi |
#12 |
Incorrecto
|
0.029 s | 7 KBi |
#13 |
Incorrecto
|
0.025 s | 3 KBi |
#14 |
Incorrecto
|
0.031 s | 3 KBi |
#15 |
Incorrecto
|
0.026 s | 3 KBi |
#16 |
Incorrecto
|
0.027 s | 3 KBi |
#17 |
Correcto
|
0.113 s | 12 KBi |
#18 |
Incorrecto
|
0.103 s | 11 KBi |
#19 |
Incorrecto
|
0.089 s | 12 KBi |
#20 |
Correcto
|
0.161 s | 12 KBi |
#21 |
Correcto
|
0.129 s | 11 KBi |
#22 |
Incorrecto
|
0.096 s | 11 KBi |
#23 |
Incorrecto
|
0.132 s | 11 KBi |
#24 |
Incorrecto
|
0.134 s | 11 KBi |
"""test of sum max subarray""" def find(a): if len(a) == 1: return a[0] ini = a[0] for j in range(1, len(a)): sj = ini + a[j] best = max(ini, sj) ini = sj return best n = int(input()) a = [int(x) for x in input().split()] print(find(a))