# 신입사원
from sys import stdin
from operator import itemgetter
t = int(stdin.readline()) # 테스트 케이스 개수 1~20
for i in range(t):
cnt = 1
n = int(stdin.readline()) # 지원자의 숫자
people = []
for j in range(n):
paper, interview = list(map(int, input().split()))
people.append([paper, interview])
people.sort(key=itemgetter(0))
res = people[0][1]
for j in range(n):
if people[j][1] < res:
cnt += 1
res = people[j][1]
else:
pass
print(cnt)
[파이썬] 백준 1157: 단어 공부 (구현, 문자열) (0) | 2021.08.28 |
---|---|
[파이썬] 백준 1152: 단어의 개수 (구현, 문자열) (0) | 2021.08.28 |
[파이썬] 백준 5585: 거스름돈 (그리디 알고리즘) (0) | 2021.08.28 |
[파이썬] 백준 2217: 로프 (그리디 알고리즘) (0) | 2021.08.28 |
[파이썬] 백준 1931: 회의실 배정 (그리디 알고리즘) (0) | 2021.08.28 |