import sys
import heapq as hq
input = sys.stdin.readline
n = int(input())
times = []
for _ in range(n):
times.append(list(map(int, input().split())))
times.sort(key=lambda x:x[0])
arr = [0]
count = 1
for start, end in times:
if start >= arr[0]:
hq.heappop(arr)
else:
count += 1
hq.heappush(arr, end)
print(count)
'Algorithm > Python' 카테고리의 다른 글
[Algorithm|Python] 백준 11053번 (0) | 2025.02.19 |
---|---|
[Python|Algorithm] 백준 1003번 파이썬 (0) | 2025.02.18 |
[Algorithm|Python] 백준 1946번 / 99클럽 19일차 TIL (0) | 2025.02.14 |
[Algorithm|Python] 백준 147503번 / 99클럽 18일차 (0) | 2025.02.13 |
[Algorithm|Python] 백준 11399번 / 99클럽 17일차 TIL (0) | 2025.02.12 |