SOLUTION INFO
Python · main.py
import sys
import heapq
def input():
return sys.stdin.readline().rstrip()
N = int(input())
lecture = []
for _ in range(N):
heapq.heappush(lecture, list(map(int, input().split())))
end_points = []
while lecture:
l = heapq.heappop(lecture)
if end_points:
if l[0] >= end_points[0]:
heapq.heappop(end_points)
heapq.heappush(end_points, l[1])
print(len(end_points))
SOLUTION DESCRIPTION
풀이 설명
등록된 풀이 설명이 없습니다.