fork(1) download
  1. import sys
  2.  
  3. class person:
  4. def __init__(self, weight:int, high:int, win:int):
  5. self.weight = weight
  6. self.high = high
  7. self.win = win
  8.  
  9. n = int(sys.stdin.readline().rstrip()) #개행문자까지 같이 받아서 rstrip 필수
  10. lane = []
  11.  
  12. for i in range(0, n, 1):
  13. a, b = map(int, sys.stdin.readline().rstrip().split())# 공백 기준 나눠서 숫자로 변환
  14. lane.append(person(a, b, n))
  15.  
  16. for i in lane:
  17. for j in lane:
  18. if i.weight > j.weight and i.high > j.high:
  19. i.win -= 1
  20.  
  21. for l in lane:
  22. print(l.win)
Success #stdin #stdout 0.09s 14116KB
stdin
5
55 185
58 183
88 186
60 175
46 155
stdout
4
4
1
4
5