We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a9fc31f commit cae4918Copy full SHA for cae4918
최어진/10주차/260306.py
@@ -0,0 +1,21 @@
1
+# 백준 1931번: 회의실 배정 (2회차)
2
+
3
+import sys
4
5
+input = sys.stdin.readline
6
7
+# N <= 10^5
8
+N = int(input())
9
+meetings = [list(map(int, input().rstrip().split())) for _ in range(N)]
10
+meetings.sort(key=lambda x:(x[1], x[0]))
11
12
+answer = 0
13
+last_end = -1
14
15
+for start, end in meetings:
16
+ if last_end <= start:
17
+ # print(start, end)
18
+ last_end = end
19
+ answer += 1
20
21
+print(answer)
0 commit comments