题解 | #Redraiment的走法#
Redraiment的走法
https://www.nowcoder.com/practice/24e6243b9f0446b081b1d6d32f2aa3aa
num1 = int(input().strip()) list1 = list(map(int,input().strip().split(" "))) table1 = {} def dizengzuichang(a): for i in range(len(a)-1,-1,-1): if i == len(a)-1: table1[i] = 1 else: temp=[] for j in range(i,len(a)): if a[i] < a[j]: temp.append(j) if temp: table1[i] = max([table1[x] for x in temp])+1 else: table1[i] =1 re = max([table1[x] for x in table1]) return re print(dizengzuichang(list1))