Skip to content

Commit 92a185b

Browse files
committed
[BOJ] 11722 가장 긴 감소하는 부분 수열 (S2)
1 parent 3c4fa91 commit 92a185b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

김지호/3주차/2601013.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# https://www.acmicpc.net/problem/11722
2+
import sys
3+
from collections import defaultdict
4+
from collections import deque
5+
6+
sys.stdin = open("../input.txt",'r')
7+
8+
9+
N = int(input())
10+
numbers = list(map(int,input().split()))
11+
12+
dp = [1] * N
13+
14+
for i in range(N):
15+
for j in range(0, i):
16+
if numbers[i] < numbers[j] :
17+
dp[i] = max(dp[i], dp[j]+1)
18+
19+
print(max(dp))

0 commit comments

Comments
 (0)