-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1931.py
More file actions
34 lines (27 loc) · 674 Bytes
/
1931.py
File metadata and controls
34 lines (27 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# 회의실 배정
import sys
input = sys.stdin.readline
N = int(input())
meeting = []
count = 0
for _ in range(N):
start, end = map(int, input().split())
meeting.append((start, end))
meeting.sort(key=lambda x: (x[1], x[0]))
nextTime = 0
for (start, end) in meeting:
if start >= nextTime:
nextTime = end
count += 1
# while meeting:
# hour, start, end = heapq.heappop(meeting)
# isPossible = True
# for i in range(start, end):
# if hours[i] == 1:
# isPossible = False
# break
# if isPossible:
# count += 1
# for i in range(start, end):
# hours[i] = 1
print(count)