思想转载于:http://blog.csdn.net/hulamua/article/details/52539087
自己用python代码实现:
import sys
str1=sys.stdin.readline().strip().split()
A=[int(i) for i in str1]
d=[1]
re=[]
for i in range(len(A)):
re.append([1])
for i in range(1,len(A)):
for j in range(i):
if A[j]<A[i]:
re[i].append(d[j]+1)
d.append(max(re[i]))
print max(d)