https://www.acmicpc.net/problem/11054import sysinput = sys.stdin.readlinen = int(input())S = list(map(int, input().split()))reversedS = list(reversed(S))incDp = [1] * ndecDp = [1] * ndp = [0] * nfor i in range(n): for j in range(i): if S[i] > S[j]: incDp[i] = max(incDp[i], incDp[j]+1) if reversedS[i] > reversedS[j]: decDp[i] = max(decDp[i], decDp[j] + 1)dec..