https://www.acmicpc.net/problem/11000
코드
import sys
from heapq import heappop, heappush
input = sys.stdin.readline
n = int(input())
classes = []
for _ in range(n):
s, t = map(int, input().split())
classes.append([s, t])
classes.sort()
used = []
for i in range(n):
if used and used[0] <= classes[i][0]:
heappop(used)
heappush(used, classes[i][1])
print(len(used))
'문제풀이 > Greedy' 카테고리의 다른 글
[Python/파이썬] 백준 13413번 오셀로 재배치 (0) | 2025.04.29 |
---|---|
[Python/파이썬] 백준 12782번 비트 우정지수 (0) | 2025.04.25 |
[Python/파이썬] 백준 3216번 다운로드 (0) | 2025.04.23 |
[Python/파이썬] 백준 2790번 F7 (0) | 2025.04.14 |
[Python/파이썬] 백준 30404번 오리와 박수치는 춘배 (0) | 2025.04.04 |