Skip to content

Commit c567650

Browse files
authored
#31 : 1931_회의실 배정
#31 : Week7_예원이니
1 parent 3ddd925 commit c567650

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

이티예원/1931_회의실 배정

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
N = int(input())
2+
time = []
3+
4+
5+
for i in range(N):
6+
start, end = map(int, input().split())
7+
time.append([start, end])
8+
9+
10+
time = sorted(time, key = lambda a : a[0])
11+
time = sorted(time, key = lambda a : a[1])
12+
13+
finish = 0
14+
cnt = 0
15+
16+
for start, end in time:
17+
if start >= finish:
18+
cnt += 1
19+
finish = end
20+
21+
print(cnt)

0 commit comments

Comments
 (0)