diff --git a/H0ngJu/README.md b/H0ngJu/README.md index d0ad3845..9e6c102d 100644 --- a/H0ngJu/README.md +++ b/H0ngJu/README.md @@ -24,7 +24,9 @@ | 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 | +| 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 | + +| 26차시 | 2024.08.24 | 그리디 | [신입사원](https://www.acmicpc.net/problem/1946) | https://github.com/AlgoLeadMe/AlgoLeadMe-1/pull/237 | --- diff --git "a/H0ngJu/\352\267\270\353\246\254\353\224\224/\354\213\240\354\236\205\354\202\254\354\233\220.py" "b/H0ngJu/\352\267\270\353\246\254\353\224\224/\354\213\240\354\236\205\354\202\254\354\233\220.py" new file mode 100644 index 00000000..21d9e280 --- /dev/null +++ "b/H0ngJu/\352\267\270\353\246\254\353\224\224/\354\213\240\354\236\205\354\202\254\354\233\220.py" @@ -0,0 +1,19 @@ +import sys + +def input(): return sys.stdin.readline().rstrip() + +T = int(input()) + +for _ in range(T): + N = int(input()) + apply = [list(map(int, input().split())) for _ in range(N)] + apply = sorted(apply) + top = 0 + cnt = 1 + + for i in range(1, N): + if apply[i][1] < apply[top][1]: + top = i + cnt += 1 + + print(cnt) \ No newline at end of file