题解 | #Redraiment的走法#

Redraiment的走法

https://www.nowcoder.com/practice/24e6243b9f0446b081b1d6d32f2aa3aa

num = int(input().strip())
step = 0
list1 = list(map(int,input().strip().split(" ")))
def computestep(list1,num):
    re = [1]*num
    for i in range(num-1,-1,-1):
        try:
            re[i] += max([re[j] for j in range(i,num) if list1[j]>list1[i]])
        except:
            continue
    return re
print(max(computestep(list1,num)))

全部评论

相关推荐

投递阿里巴巴控股集团等公司7个岗位 >
点赞 评论 收藏
转发
头像
不愿透露姓名的神秘牛友
04-08 00:50
点赞 评论 收藏
转发
点赞 收藏 评论
分享
牛客网
牛客企业服务