Python 递增子序列的最大值总和代码如下所示:
arr = [1,101,2,3,100,4,5]
msis = [elem for elem in arr]
for x in range(1,len(arr),1):
for y in range(0,x,1):
if arr[x] > arr[y]:
msis[x] += arr[y]
print(max(msis))
以上代码运行结果为:
106