[백준] 7568번 : 덩치 (Python3)

2020. 8. 27. 17:29알고리즘

예제 입력 1

5

55 185

58 183

88 186

60 175

46 155

예제 출력 1

2 2 1 2 5

 

풀이 #1

N=int(input())
people=[]
for i in range(N):
    X, Y=map(int, input().split())
    people.append([X, Y])

for i in range(N):
    rank=1
    for j in range(N):
        if i==j:
            continue
        if people[j][0]>people[i][0] and people[j][1]>people[i][1]:
            rank+=1
    print(rank, end=" ")