728x90
https://www.acmicpc.net/problem/7568
7568번: 덩치
우리는 사람의 덩치를 키와 몸무게, 이 두 개의 값으로 표현하여 그 등수를 매겨보려고 한다. 어떤 사람의 몸무게가 x kg이고 키가 y cm라면 이 사람의 덩치는 (x, y)로 표시된다. 두 사람 A 와 B의 덩
www.acmicpc.net
import sys
n = int(sys.stdin.readline())
people, res, cnt = [], [], 1
for _ in range(n):
weight, height = map(int, sys.stdin.readline().split())
people.append((weight, height))
for i in range(n): #1
for j in range(n): #2
if people[i][0] < people[j][0] and people[i][1] < people[j][1]: #3
cnt += 1
res.append(cnt) #4
cnt = 1 #5
print(*res) #6
728x90
'[Coding Test] > [백준]' 카테고리의 다른 글
[백준] 1182: 부분수열의 합 (0) | 2022.06.28 |
---|---|
[백준] 2178: 미로 탐색 (0) | 2022.06.27 |
[백준] 2798: 블랙잭 (0) | 2022.06.24 |
[백준] 2231: 분해합 (0) | 2022.06.24 |
[백준] 1018: 체스판 다시 칠하기 (0) | 2022.06.24 |