import sys
T = int(input()) #테스트케이스
for i in range(0,T):
Cnt = 1
people = []
N = int(input())
for i in range(N):
Paper, Interview = map(int,sys.stdin.readline().split())
people.append([Paper, Interview])
people.sort() # 서류 기준 오름차순 정렬
Max = people[0][1]
for i in range(1,N):
if Max > people[i][1]:
Cnt += 1
Max = people[i][1]
print(Cnt)
'Coding Test > 정렬' 카테고리의 다른 글
[TIL] 정렬(백준 7795파이썬) 2022.03.28 (0) | 2022.03.28 |
---|---|
[TIL] 정렬(백준 16112 파이썬) 2022.03.10 (작성중) (0) | 2022.03.11 |
[TIL] 정렬(백준 18870 파이썬) 2022.01.29 (0) | 2022.01.30 |
[TIL] 정렬(백준 18870 파이썬) 2022.01.28 (0) | 2022.01.28 |
[TIL] 정렬(백준 11399 파이썬) 2022.01.27 (0) | 2022.01.27 |