diff --git "a/H0ngJu/DP/\354\240\204\352\271\203\354\244\204.py" "b/H0ngJu/DP/\354\240\204\352\271\203\354\244\204.py" new file mode 100644 index 00000000..49339973 --- /dev/null +++ "b/H0ngJu/DP/\354\240\204\352\271\203\354\244\204.py" @@ -0,0 +1,17 @@ +import sys + +def input() : return sys.stdin.readline().rstrip() + +N = int(input()) +info = [list(map(int, input().split())) for _ in range(N)] + +info.sort() + +LIS = [1] * N + +for i in range(1, N): + for j in range(i): + if info[j][1] < info[i][1]: + LIS[i] = max(LIS[i], LIS[j] + 1) + +print(N-max(LIS)) \ No newline at end of file diff --git a/H0ngJu/README.md b/H0ngJu/README.md index c36db458..68c4dfed 100644 --- a/H0ngJu/README.md +++ b/H0ngJu/README.md @@ -1,38 +1,39 @@ ## ✏️ 기록 -| 차시 | 날짜 | 문제유형 | 링크 | 풀이 | -| :----: | :--------: | :------: | :-----------------------------------------------------------------------------------: | :-------------------------------------------------: | -| 1차시 | 2024.03.05 | 큐 | [프로세스](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 | -| 2차시 | 2024.03.07 | 큐 | [다리를 지나는 트럭](https://school.programmers.co.kr/learn/courses/30/lessons/42583) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/153 | -| 3차시 | 2024.03.10 | 힙 | [N번째 큰 수](https://www.acmicpc.net/problem/2075) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/156 | -| 4차시 | 2024.03.13 | 힙 | [문제집](https://www.acmicpc.net/problem/1766) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/158 | -| 5차시 | 2024.03.16 | 구현 | [요세푸스 문제](https://www.acmicpc.net/problem/1158) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/161 | -| 6차시 | 2024.03.19 | 스택 | [오큰수](https://www.acmicpc.net/problem/17298) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/164 | -| 7차시 | 2024.03.22 | DP | [1,2,3 더하기](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/166 | -| 8차시 | 2024.03.16 | DP | [쉬운 계단 수](https://www.acmicpc.net/problem/10844) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/170 | -| 9차시 | 2024.03.22 | DP | [RGB거리 2](https://www.acmicpc.net/problem/17404) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/172 | -| 10차시 | 2024.04.03 | BFS | [숨바꼭질 4](https://www.acmicpc.net/problem/13913) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/177 | -| 11차시 | 2024.04.07 | 구현 | [사탕 게임](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/178 | -| 12차시 | 2024.04.09 | DFS | [ABCDE](https://www.acmicpc.net/problem/13023) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/180 | -| 13차시 | 2024.05.06 | 완전탐색 | [리모컨](https://www.acmicpc.net/problem/1107) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/181 | -| 14차시 | 2024.05.09 | DFS | [치킨배달](https://www.acmicpc.net/problem/15686) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/183 | -| 15차시 | 2024.05.14 | 그리디 | [A와 B](https://www.acmicpc.net/problem/12904) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/188 | -| 16차시 | 2024.05.14 | BFS | [뱀과 사다리 게임](https://www.acmicpc.net/problem/16928) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/191 | -| 17차시 | 2024.05.22 | BFS | [적록색약](https://www.acmicpc.net/problem/10026) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/195 | -| 18차시 | 2024.05.26 | DFS | [계란으로 계란치기](https://www.acmicpc.net/problem/16987) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/199 | -| 19차시 | 2024.05.31 | DP | [합분해](https://www.acmicpc.net/problem/2225) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/202 | -| 20차시 | 2024.06.03 | 백트래킹 | [스타트와 링크](https://www.acmicpc.net/problem/14889) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/206 | -| 21차시 | 2024.06.07 | 그리디 | [행복 유치원](https://www.acmicpc.net/problem/13164) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/208 | -| 22차시 | 2024.08.06 | 해시 | [의상](https://school.programmers.co.kr/learn/courses/30/lessons/42578) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/224 | -| 23차시 | 2024.08.10 | 해시 | [베스트앨범](https://school.programmers.co.kr/learn/courses/30/lessons/42579) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/227 | -| 24차시 | 2024.08.17 | BFS | [아기상어](https://www.acmicpc.net/problem/16236) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/233 | -| 25차시 | 2024.08.17 | DFS | [친구비](https://www.acmicpc.net/problem/16562) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/234 | -| 26차시 | 2024.08.24 | 그리디 | [신입사원](https://www.acmicpc.net/problem/1946) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/237 | -| 27차시 | 2024.08.27 | DFS | [트리의 지름](https://www.acmicpc.net/problem/1967) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/240 | -| 28차시 | 2024.09.04 | 벨만포드 | [타임머신](https://www.acmicpc.net/problem/11657) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/244 | -| 29차시 | 2024.09.06 | 구현 | [톱니바퀴](https://www.acmicpc.net/problem/14891) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/245 | -| 30차시 | 2024.09.27 | 수학 | [Fly me to the Alpha Centauri](https://www.acmicpc.net/problem/1011) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/248 | -| 31차시 | 2024.10.05 | 정렬 | [선 긋기](https://www.acmicpc.net/problem/2170) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/249 | -| 32차시 | 2024.10.14 | 이분 탐색 | [기타 레슨](https://www.acmicpc.net/problem/2343) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/252 | -| 33차시 | 2024.11.08 | 백트래킹 | [병원 거리 최소화](https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance/submissions?page=11&pageSize=5) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/253 | -| 34차시 | 2024.11.19 | 누적합 | [개똥벌레](https://www.acmicpc.net/problem/3020) | +| 차시 | 날짜 | 문제유형 | 링크 | 풀이 | +| :----: | :--------: | :-------: | :-------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------: | +| 1차시 | 2024.03.05 | 큐 | [프로세스](https://school.programmers.co.kr/learn/courses/30/lessons/42587) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/151 | +| 2차시 | 2024.03.07 | 큐 | [다리를 지나는 트럭](https://school.programmers.co.kr/learn/courses/30/lessons/42583) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/153 | +| 3차시 | 2024.03.10 | 힙 | [N번째 큰 수](https://www.acmicpc.net/problem/2075) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/156 | +| 4차시 | 2024.03.13 | 힙 | [문제집](https://www.acmicpc.net/problem/1766) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/158 | +| 5차시 | 2024.03.16 | 구현 | [요세푸스 문제](https://www.acmicpc.net/problem/1158) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/161 | +| 6차시 | 2024.03.19 | 스택 | [오큰수](https://www.acmicpc.net/problem/17298) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/164 | +| 7차시 | 2024.03.22 | DP | [1,2,3 더하기](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/166 | +| 8차시 | 2024.03.16 | DP | [쉬운 계단 수](https://www.acmicpc.net/problem/10844) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/170 | +| 9차시 | 2024.03.22 | DP | [RGB거리 2](https://www.acmicpc.net/problem/17404) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/172 | +| 10차시 | 2024.04.03 | BFS | [숨바꼭질 4](https://www.acmicpc.net/problem/13913) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/177 | +| 11차시 | 2024.04.07 | 구현 | [사탕 게임](https://www.acmicpc.net/problem/9095) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/178 | +| 12차시 | 2024.04.09 | DFS | [ABCDE](https://www.acmicpc.net/problem/13023) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/180 | +| 13차시 | 2024.05.06 | 완전탐색 | [리모컨](https://www.acmicpc.net/problem/1107) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/181 | +| 14차시 | 2024.05.09 | DFS | [치킨배달](https://www.acmicpc.net/problem/15686) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/183 | +| 15차시 | 2024.05.14 | 그리디 | [A와 B](https://www.acmicpc.net/problem/12904) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/188 | +| 16차시 | 2024.05.14 | BFS | [뱀과 사다리 게임](https://www.acmicpc.net/problem/16928) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/191 | +| 17차시 | 2024.05.22 | BFS | [적록색약](https://www.acmicpc.net/problem/10026) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/195 | +| 18차시 | 2024.05.26 | DFS | [계란으로 계란치기](https://www.acmicpc.net/problem/16987) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/199 | +| 19차시 | 2024.05.31 | DP | [합분해](https://www.acmicpc.net/problem/2225) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/202 | +| 20차시 | 2024.06.03 | 백트래킹 | [스타트와 링크](https://www.acmicpc.net/problem/14889) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/206 | +| 21차시 | 2024.06.07 | 그리디 | [행복 유치원](https://www.acmicpc.net/problem/13164) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/208 | +| 22차시 | 2024.08.06 | 해시 | [의상](https://school.programmers.co.kr/learn/courses/30/lessons/42578) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/224 | +| 23차시 | 2024.08.10 | 해시 | [베스트앨범](https://school.programmers.co.kr/learn/courses/30/lessons/42579) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/227 | +| 24차시 | 2024.08.17 | BFS | [아기상어](https://www.acmicpc.net/problem/16236) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/233 | +| 25차시 | 2024.08.17 | DFS | [친구비](https://www.acmicpc.net/problem/16562) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/234 | +| 26차시 | 2024.08.24 | 그리디 | [신입사원](https://www.acmicpc.net/problem/1946) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/237 | +| 27차시 | 2024.08.27 | DFS | [트리의 지름](https://www.acmicpc.net/problem/1967) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/240 | +| 28차시 | 2024.09.04 | 벨만포드 | [타임머신](https://www.acmicpc.net/problem/11657) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/244 | +| 29차시 | 2024.09.06 | 구현 | [톱니바퀴](https://www.acmicpc.net/problem/14891) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/245 | +| 30차시 | 2024.09.27 | 수학 | [Fly me to the Alpha Centauri](https://www.acmicpc.net/problem/1011) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/248 | +| 31차시 | 2024.10.05 | 정렬 | [선 긋기](https://www.acmicpc.net/problem/2170) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/249 | +| 32차시 | 2024.10.14 | 이분 탐색 | [기타 레슨](https://www.acmicpc.net/problem/2343) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/252 | +| 33차시 | 2024.11.08 | 백트래킹 | [병원 거리 최소화](https://www.codetree.ai/training-field/frequent-problems/problems/min-of-hospital-distance/submissions?page=11&pageSize=5) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/253 | +| 34차시 | 2024.11.19 | 누적합 | [개똥벌레](https://www.acmicpc.net/problem/3020) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/256 | +| 35차시 | 2024.11.23 | DP | [전깃줄](https://www.acmicpc.net/problem/2565) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/258 |