DP
Redraiment的走法
http://www.nowcoder.com/questionTerminal/24e6243b9f0446b081b1d6d32f2aa3aa
import sys
while True: # 动态规划解最长上升子序列
try:
res = -1e20
n = int(sys.stdin.readline())
numbers = list(map(int, input().split()))
F = [1 for i in range(n)]
for i in range(n): for j in range(i): if numbers[j] < numbers[i]: F[i] = max(F[i], F[j]+1) for i in range(n): res = max(res, F[i]) print(res) except: break