顺丰最长子序列
class Solution(): def fun(self, line, n): if n < 1: return 0 if n == 1: return 1 dp = [0] * n size = 0 for x in line: i, j = 0, size while i != j: m = (i + j) // 2 if dp[m] <= x: i = m + 1 else: j = m dp[i] = x size = max(i+1, size) return size n = int(input().strip()) line = input().strip().split() line = [int(x) for x in line] so = Solution() print(so.fun(line, n))#笔试题目##顺丰科技#