본문 바로가기
공부/알고리즘, 백준

백준 1946번 파이썬

by Excidus 2023. 1. 12.

https://www.acmicpc.net/problem/1946

 

1946번: 신입 사원

첫째 줄에는 테스트 케이스의 개수 T(1 ≤ T ≤ 20)가 주어진다. 각 테스트 케이스의 첫째 줄에 지원자의 숫자 N(1 ≤ N ≤ 100,000)이 주어진다. 둘째 줄부터 N개 줄에는 각각의 지원자의 서류심사 성

www.acmicpc.net

t=int(input())
for i in range(t):
    n=int(input())
    a=[]
    for j in range(n):
        x,y=map(int,input().split())
        a.append([x,y])
    a.sort()
    l=a[0][1] #뒤 점수
    index=1
    for j in range(1,n):
        if a[j][1]<l:
            l=a[j][1]
            index+=1
    print(index)

'공부 > 알고리즘, 백준' 카테고리의 다른 글

vsc 파이썬 전체 주석 처리  (0) 2023.01.17
백준 2739번 파이썬  (0) 2023.01.17
백준 1712번 파이썬  (0) 2023.01.02
백준 2884번 파이썬  (0) 2023.01.02
백준 2480번 파이썬  (0) 2023.01.02