import sys
input = sys.stdin.readline
t = int(input())
for tc in range(t):
n = int(input())
rank = []
cnt = 1
for i in range(n):
paper, inerview = map(int,input().split())
rank.append([paper, inerview])
rank.sort(key=lambda x:x[0]) #서류점수 기준으로 오름차순 정렬
MAX = rank[0][1] # 첫번째 인터뷰 점수를 기준으로 뒤에 점수보다 높아야 입사 가능
for i in range(1,n):
if MAX > rank[i][1]:
cnt += 1
MAX = rank[i][1] #다음 비교를 위함
print(cnt)
'문제풀이 > 백준(Boj) 문제풀이' 카테고리의 다른 글
[백준][그리디 알고리즘] 2720. 세탁소 사장 동혁 (파이썬/Python) (0) | 2021.10.03 |
---|---|
[백준][그리디 알고리즘] 1789. 수들의 합(파이썬/Python) (0) | 2021.10.02 |
[백준][그리디 알고리즘] 10162. 전자레인지 (파이썬/Python) (0) | 2021.09.30 |
[백준][그리디 알고리즘] 5585. 거스름돈(파이썬/Python) (0) | 2021.09.30 |
[백준][그리디 알고리즘] 1026. 보물(파이썬/Python) (0) | 2021.09.30 |