Files
Algorithm/백준/11000.py
2026-04-11 11:56:33 +09:00

26 lines
384 B
Python

import sys
import heapq
input = sys.stdin.readline
n = int(input())
table = []
for _ in range(n):
start, end = map(int, input().split())
table.append((start, end))
table.sort()
rooms = []
heapq.heappush(rooms, table[0][1])
for i in range(1, n):
if table[i][0] >= rooms[0]:
heapq.heappop(rooms)
heapq.heappush(rooms, table[i][1])
print(len(rooms))