알고리즘 문제 풀기/BOJ
BOJ 1931 - 회의실배정
bug_maker
2019. 12. 25. 16:04
https://www.acmicpc.net/problem/1931
BOJ 1931 - 회의실배정
작성언어: Python3
xxxxxxxxxx
n = int(input())
conf = []
for i in range(n):
conf.append(list(map(int, input().split())))
conf.sort(key=lambda x : [x[1],x[0]])
cnt = 1
j = 0
for i in range(1, len(conf)):
if(conf[i][0] >= conf[j][1]):
cnt += 1
j = i
print(cnt)
pc 환경에서 코드를 보는 것을 권장합니다.