|
|
@ -18,4 +18,26 @@ for p in lowList: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(summa) |
|
|
|
print(summa) |
|
|
|
print(lowList) |
|
|
|
explored = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def explore(x,y): |
|
|
|
|
|
|
|
if lines[x][y] == 9 or (x,y) in explored: |
|
|
|
|
|
|
|
return 0 |
|
|
|
|
|
|
|
explored.append((x,y)) |
|
|
|
|
|
|
|
size = 1 |
|
|
|
|
|
|
|
if y != 0: |
|
|
|
|
|
|
|
size += explore(x,y-1) |
|
|
|
|
|
|
|
if y != len(lines[x]) - 1: |
|
|
|
|
|
|
|
size += explore(x,y+1) |
|
|
|
|
|
|
|
if x != 0: |
|
|
|
|
|
|
|
size += explore(x-1,y) |
|
|
|
|
|
|
|
if x != len(lines) - 1: |
|
|
|
|
|
|
|
size += explore(x+1,y) |
|
|
|
|
|
|
|
return size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sizes = [0]*len(lowList) |
|
|
|
|
|
|
|
for i in range(len(lowList)): |
|
|
|
|
|
|
|
sizes[i] = explore(lowList[i][0],lowList[i][1]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sizes.sort() |
|
|
|
|
|
|
|
print(sizes[-1] * sizes[-2] * sizes[-3]) |