题解 | Redraiment的走法
import sys raw_input = [] for i,line in enumerate(sys.stdin): raw_input.append(line.strip()) if i == 2: break n = int(raw_input[0]) heights = [int(i) for i in raw_input[1].split(' ')] dp = [] for i in range(n): dp.append(max([dp[j] + 1 if heights[i] > heights[j] else 1 for j in range(0, i)] + [1])) print(max(dp))