[백준] 11000 : 강의실 배정 (파이썬)
·
Algorithm/Greedy
스위핑, 우선순위큐, 그리디 문제https://www.acmicpc.net/problem/11000💡 풀이코드 (성공 - 스위핑)import sys import heapq n = int(sys.stdin.readline())lecture = []for _ in range(n): a, b = map(int, sys.stdin.readline().split()) heapq.heappush(lecture, (a, 1)) # start heapq.heappush(lecture, (b, 0)) # end cnt = 0ans = 0while lecture: a, b = heapq.heappop(lecture) if b == 1: cnt += 1 else: ..