题目描述
python
简单python版本
import sys
gird = []
for line in sys.stdin:
gird.append((line.split()))
n = int((gird.pop(0))[0])
nums = [int(i) for i in gird[0]]
#题目解
if not nums:print(0)
dp = [1]*n
for i in range(n):
for j in range(i):
if nums[i] > nums[j]:
dp[i] = max(dp[i],dp[j]+1)
print(max(dp))