Caso # | Resultado | Tiempo | Memoria |
---|---|---|---|
#1 |
Correcto
|
0.014 s | 3 KBi |
#2 |
Correcto
|
0.014 s | 3 KBi |
#3 |
Correcto
|
0.015 s | 3 KBi |
#4 |
Correcto
|
0.018 s | 3 KBi |
#5 |
Correcto
|
0.014 s | 3 KBi |
#6 |
Correcto
|
0.038 s | 3 KBi |
#7 |
Correcto
|
0.015 s | 3 KBi |
#8 |
Correcto
|
0.013 s | 3 KBi |
#9 |
Correcto
|
0.015 s | 3 KBi |
#10 |
Correcto
|
0.016 s | 3 KBi |
#11 |
Correcto
|
0.02 s | 3 KBi |
#12 |
Correcto
|
0.014 s | 3 KBi |
#13 |
Correcto
|
0.024 s | 3 KBi |
#14 |
Correcto
|
0.574 s | 3 KBi |
#15 |
Correcto
|
0.008 s | 3 KBi |
#16 |
Correcto
|
0.826 s | 3 KBi |
#17 |
Correcto
|
0.58 s | 3 KBi |
#18 |
Correcto
|
0.019 s | 3 KBi |
#19 |
Correcto
|
0.015 s | 3 KBi |
def maximaArea(edificio): areaMaxima = len(edificio) for i in range(2,max(edificio)+1): areas =[] areaParcial= 0 for j in edificio: if j<i and areaParcial>0: areas.append(areaParcial) areaParcial =0 continue if j<i: continue elif j>=i: areaParcial+=i if(len(areas)>0): areaParcial=max(areas) if areaParcial>areaMaxima: areaMaxima=areaParcial return(areaMaxima) if __name__ == "__main__": n = input().split() edificios = input().split() edificios = list(map(lambda x: int(x),edificios)) print(maximaArea(edificios))