Study/Coding Test

백준 7568번 덩치

mameul 2024. 11. 20. 20:07
728x90

N = int(input())

L = []

for _ in range(N):
    x, y = map(int, input().split())
    L.append([x,y])
    
ret = [1]*N

for i in range(N):
    for j in range(i+1,N):
        if L[i][0] < L[j][0] and L[i][1] < L[j][1]:
            ret[i]+=1
        elif L[i][0] > L[j][0] and L[i][1] > L[j][1] :
            ret[j]+=1
        else:
            continue


for k in ret:
    print(k,end=' ')