Algorithm/Baekjoon
[백준] 7568 : 덩치 - Python
Dev.sohee
2020. 4. 8. 23:30
https://www.acmicpc.net/problem/7568
7568번: 덩치
우리는 사람의 덩치를 키와 몸무게, 이 두 개의 값으로 표현하여 그 등수를 매겨보려고 한다. 어떤 사람의 몸무게가 x kg이고 키가 y cm라면 이 사람의 덩치는 (x,y)로 표시된다. 두 사람 A 와 B의 덩치가 각각 (x,y), (p,q)라고 할 때 x>p 그리고 y>q 이라면 우리는 A의 덩치가 B의 덩치보다 "더 크다"고 말한다. 예를 들어 어떤 A, B 두 사람의 덩치가 각각 (56,177), (45,165) 라고 한다면 A의 덩치가 B보다 큰
www.acmicpc.net
import sys
input = sys.stdin.readline
N = int(input())
people = [list(map(int, input().split())) for _ in range(N)]
result = []
for w, h in people:
cnt = 1
for a, b in people:
if (w < a) and (h < b):
cnt += 1
result.append(cnt)
for i in range(N):
print(result[i], end = ' ')