-*- coding: utf-8 -*-
"""
Created on Wed Oct 23 15:20:33 2019
@author: asus
"""
value_list=[[0]*2 for x in range(2)]
longest_list=[[0]*2 for y in range(2)]
def fun(i,j):
max=0
if(longest_list[i][j]>0):
return longest_list[i][j]
if(i-1>0 and value_list[i][j]>value_list[i-1][j] or max
max=fun(i-1,j)
if(j-1>0 and value_list[i][j]>value_list[i][j-1] or max
max=fun(i,j-1)
if(value_list[i][j]>value_list[i+1][j] or max
max=fun(i+1,j)
if(value_list[i][j]>value_list[i][j+1] or max
max=fun(i,j+1)
return max+1
print('请输入value_list的值:')
for k in range(0,2):
for t in range(0,2):
value_list[k][t]=int(input())
maxway=0
for m in range(0,2):
for n in range(0,2):
longest_list[m][n]=fun(m,n)
if(longest_list[m][n]>maxway):
maxway=longest_list[m][n]
print(maxway)
print(longest_list)