728x90
분석
- 1 ≤ N ≤ 1,000
- 1 ≤ Ai ≤ 1,000
풀이
import sys
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
dp = [1]*n
for i in range(1,n):
for j in range(i):
if arr[i] > arr[j]:
dp[i] = max(dp[i], dp[j]+1)
print(max(dp))
728x90