Skip to content

Commit

Permalink
가장 긴 감소하는 부분 수열(#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
ezidayzi committed Mar 12, 2022
1 parent fe71614 commit 2d2a9bb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Algorithm/BOJ/11722.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
n = int(input())
array = list(map(int, input().split()))

dp = [1] * (n+1)

for i in range(n):
for j in range(i):
if array[i] < array[j]:
dp[i] = max(dp[i], dp[j]+1)

print(max(dp))

0 comments on commit 2d2a9bb

Please sign in to comment.