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
- hackerrank
- Kaggle
- 프로그래머스 파이썬
- 백준
- 파이썬
- ubuntu
- gs25
- AI 경진대회
- 맥북
- 프로그래머스
- leetcode
- 편스토랑
- github
- Real or Not? NLP with Disaster Tweets
- 자연어처리
- SW Expert Academy
- Baekjoon
- 캐치카페
- 금융문자분석경진대회
- 데이콘
- 편스토랑 우승상품
- ChatGPT
- programmers
- 더현대서울 맛집
- Docker
- dacon
- 우분투
- PYTHON
- 코로나19
- Git
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 17009번 : Winning Score (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Winning Score 입니다.
17009번: Winning Score
The first three lines of input describe the scoring of the Apples, and the next three lines of input describe the scoring of the Bananas. For each team, the first line contains the number of successful 3-point shots, the second line contains the number of
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def calculate_basketball_score(score_list, basketball_score_rule):
score_list = [(score * baseket_ball_score) for score, baseket_ball_score in zip(score_list, basketball_score_rule)]
return sum(score_list)
def winning_score(banana_score, apple_score):
basketball_score_rule = [3, 2, 1]
banana_basketball_score = calculate_basketball_score(score_list=banana_score,
basketball_score_rule=basketball_score_rule)
apple_basketball_score = calculate_basketball_score(score_list=apple_score,
basketball_score_rule=basketball_score_rule)
if banana_basketball_score < apple_basketball_score:
answer = "A"
elif banana_basketball_score > apple_basketball_score:
answer = "B"
else:
answer = "T"
return answer
if __name__ == "__main__":
apple_score, banana_score = [], []
for idx in range(6):
score = int(input())
if idx < 3:
apple_score.append(score)
else:
banana_score.append(score)
print(winning_score(banana_score, apple_score))
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] 25311번 : UCPC에서 가장 쉬운 문제 번호는? (Python) (0) | 2022.07.14 |
---|---|
[BaekJoon] 4589번 : Gnome Sequencing (Python) (0) | 2022.07.12 |
[BaekJoon] 25314번 : 코딩은 체육과목 입니다 (Python) (0) | 2022.07.10 |
[BaekJoon] 11945번 : 뜨거운 붕어빵 (Python) (0) | 2022.07.08 |
[BaekJoon] 1362번 : 펫 (Python) (0) | 2022.07.06 |