[알고리즘/백준] 7568번 : 덩치(python)

유현민·2022년 3월 16일
0

알고리즘

목록 보기
58/253

하나씩 가져와서 전체랑 비교하면 된다.

N = int(input())
a = [list(map(int, input().split()))for _ in range(N)]
ans = list()
for i in range(N):
    cnt = 0
    for j in range(N):
        if a[i][0] < a[j][0] and a[i][1] < a[j][1]:
            cnt += 1
    ans.append(cnt + 1)
print(*ans)
profile
smilegate megaport infra

0개의 댓글