import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
N = int(input())
rank = [list(map(int, input().split())) for _ in range(N)]
rank_asc = sorted(rank)
top = 0
result = 1
for i in range(1, len(rank_asc)):
if rank_asc[i][1] < rank_asc[top][1]:
top = i
result += 1
print(result)
'Algorithm > Python' 카테고리의 다른 글
[Python|Algorithm] 백준 1003번 파이썬 (0) | 2025.02.18 |
---|---|
[Algorithm|Python] 백준 19598번 / 99클럽 20일차 TIL (0) | 2025.02.15 |
[Algorithm|Python] 백준 147503번 / 99클럽 18일차 (0) | 2025.02.13 |
[Algorithm|Python] 백준 11399번 / 99클럽 17일차 TIL (0) | 2025.02.12 |
[Algorithm|Python] 백준 27961번 / 99클럽 16일차 TIL (0) | 2025.02.11 |