Skip to content

Commit 123ae69

Browse files
committed
[BOJ] 병사 배치하기 / 실버2 / 60분 실패
https://www.acmicpc.net/problem/18353
1 parent 186f75b commit 123ae69

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
def sort(arr,dp):
3+
global N
4+
5+
for i in range(1,N,1):
6+
for j in range(i-1,-1,-1):
7+
if arr[j] > arr[i]:
8+
dp[i] = max(dp[i],dp[j]+1)
9+
10+
11+
N = int(input())
12+
13+
arr = list(map(int,input().split()))
14+
dp = [1] * N
15+
16+
sort(arr, dp)
17+
18+
print(N-max(dp))
19+

0 commit comments

Comments
 (0)