์ค๋ฒ2 : ๋์ ๊ณํ๋ฒ ๋ฌธ์ ์ด๋ค. ํ์ด ๊ธฐ๋ณธ์ ์ธ ๋์ ๊ณํ๋ฒ ๋ฌธ์ ์ด๋ค. Code import sys input = sys.stdin.readline n = int(input()) a = [0] + list(map(int, input().split())) dp = [1 for _ in range(n + 1)] for i in range(1, n + 1): for j in range(1, i): if a[j] < a[i]: dp[i] = max(dp[i], dp[j] + 1) print(max(dp)) Reference ๋ฐฑ์ค(1965๋ฒ) - ์์๋ฃ๊ธฐ