Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- ChatGPT
- dacon
- 프로그래머스
- ubuntu
- 편스토랑
- github
- Baekjoon
- 맥북
- PYTHON
- Docker
- hackerrank
- SW Expert Academy
- gs25
- 우분투
- Git
- 금융문자분석경진대회
- 백준
- 코로나19
- AI 경진대회
- 데이콘
- 편스토랑 우승상품
- 더현대서울 맛집
- 캐치카페
- 자연어처리
- 파이썬
- Real or Not? NLP with Disaster Tweets
- Kaggle
- 프로그래머스 파이썬
- leetcode
- programmers
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 7568번 : 덩치 (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 덩치 입니다.
7568번: 덩치
우리는 사람의 덩치를 키와 몸무게, 이 두 개의 값으로 표현하여 그 등수를 매겨보려고 한다. 어떤 사람의 몸무게가 x kg이고 키가 y cm라면 이 사람의 덩치는 (x, y)로 표시된다. 두 사람 A 와 B의 덩
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def bulk_rank(bulk_info_list):
answer = []
for bulk_info in bulk_info_list:
rank = 1
weight, height = bulk_info[0], bulk_info[1]
for compare_info in bulk_info_list:
compare_weight, compare_height = compare_info[0], compare_info[1]
if weight < compare_weight and height < compare_height:
rank += 1
answer.append(str(rank))
return " ".join(answer)
if __name__ == "__main__":
bulk_info_list = []
for _ in range(int(input())):
weight, height = map(int, input().split())
bulk_info_list.append((weight, height))
print(bulk_rank(bulk_info_list))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 1747번 : 소수&팰린드롬 (Python) (0) | 2021.09.28 |
---|---|
[BaekJoon] 1251번 : 단어 나누기 (Python) (0) | 2021.09.27 |
[Programmers] 월간 코드 챌린지 시즌 3 - 없는 숫자 더하기 (Python) (0) | 2021.09.25 |
[BaekJoon] 2884번 : 알람 시계 (Python) (0) | 2021.09.24 |
[BaekJoon] 2864번 : 5와 6의 차이 (Python) (0) | 2021.09.23 |