강의실 배정문제. 여러번 풀었던 문제. 방을 몇개 가져갈꺼냐? 끝난시간이면 빼고 갈아끼워준다. import sys input = sys.stdin.readline from heapq import heappop, heappush n = int(input()) heap = [] count = 0 for _ in range(n): num, start, end = map(int, input().split()) heappush(heap, [start,end,num]) classroom = [] start, end, num = heappop(heap) heappush(classroom, end) while heap: start, end, num = heappop(heap) if classroom[0]