[Baekjoon/๐ฅSilverโ ก] 11722: ๊ฐ์ฅ ๊ธด ๊ฐ์ํ๋ ๋ถ๋ถ ์์ด
Intro
-
๊ฐ์ฅ ๊ธด ์ฆ๊ฐํ๋ ๋ถ๋ถ ์์ด์์ ์ฆ๊ฐ๋ฅผ ๊ฐ์๋ก ๋ฐ๊พผ ๋ฌธ์ ์ด๋ค.
- ๐โโ๏ธ ํ์ด๋ ํด๋น ์ฌ์ดํธ๋ฅผ ์ฐธ๊ณ ํด์ฃผ์ธ์!
Algoritm๐ฉโ๐ป
#21.01.25
#11722: ๊ฐ์ฅ ๊ธด ๊ฐ์ํ๋ ๋ถ๋ถ ์์ด
import sys
l = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))
dp = [1 for _ in range(l)]
for i in range(1, l):
for j in range(i):
if A[j] > A[i]:
if dp[j] + 1 > dp[i]:
dp[i] = dp[j] + 1
print(max(dp))
์ด๋ฒ ํฌ์คํ ์ ์ฌ๊ธฐ์
๋!! ~(หโพห~)
๋๊ธ๋จ๊ธฐ๊ธฐ