문제 링크: https://www.acmicpc.net/problem/1931
백준 알고리즘 중급 1/3 710에서 2번째 - 1931번 회의실 배정을 풀어보았다.
풀이: https://jokerldg.github.io/algorithm/2021/03/11/meeting-room.html
C++
Python
n=int(input())
time=[]
for _ in range(n):
st,end=map(int,input().split())
time.append([st,end])
time = sorted(time, key=lambda a: a[0])
time = sorted(time, key=lambda a: a[1])
last = 0
conut = 0
for i, j in time:
if i >= last:
conut += 1
last = j
print(conut)
Java
'코테용 문제풀이 > 백준' 카테고리의 다른 글
행렬 풀이 (0) | 2023.03.04 |
---|---|
ATM 풀이 (0) | 2023.03.04 |
동전 0 풀이 (0) | 2023.03.04 |
4연산 풀이 (0) | 2023.03.04 |
적록색약 풀이 (0) | 2023.03.01 |