1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
n = int(input())
time = []
for i in range(n):
first, second = map(int, input().split())
time.append((first,second))
time = sorted(time,key=lambda a:a[1])
end = 0
count = 0
for i,j in time:
if i>=end:
count+=1
end = j
print(count)
|
cs |
'알고리즘 문제 > 알고리즘 문제풀이' 카테고리의 다른 글
백준 9012 괄호 (0) | 2020.10.25 |
---|---|
백준 10773 제로 (0) | 2020.10.25 |
백준 1541 잃어버린 괄호 (0) | 2020.10.25 |
백준 11399 ATM (0) | 2020.10.25 |
백준 11047 (0) | 2020.10.25 |