number = int(input()) data = list(map(int,input().split())) def Z(data):# 动态规划,递增序列 n = [1]*len(data) for i in range(len(data)): for j in reversed(range(i)): if data[j] < data[i]: n[i] = max(n[i], n[j]+1) return n def J(data):# 动态规划,递减序列 n = [1]...