#include<stdio.h> #include<algorithm> using namespace std; int n, dp[200], sz; int main() { scanf("%d", &n); for (int i = 0; i < n; i++) { int a, pos; scanf("%d", &a); pos = lower_bound(dp, dp + sz, a) - dp; dp[pos] = a; if (pos == sz) sz++; } printf("%d", n - sz); return 0; }
2631번: 줄세우기
https://www.acmicpc.net/problem/2631
피드 구독하기:
댓글
(
Atom
)
댓글 없음 :
댓글 쓰기