[백준/파이썬] 20254번 풀이

업데이트:



문제 정보


풀이

문제

Teams from variaous universities compete in ICPC regional contests for tickets to the ICPC World Finals. The number of tickets allocated to every regional contest may be different. The allocation method in our super region, Asia Pacific, is based on a parameter called site score.

Site scores will only count teams and universities solving at least one problem, in the regional contest or its preliminary contest TOPC. In 2020, the formula for calculating the site score of the Taipei-Hsinchu regional contest is much simpler than past years. …

입력 요약
The input has only one line containing four blank-separated positive integers UR, TR, UO, and TO.

출력 요약
Output the site score of the 2020 Taipei-Hsinchu regional contest.

코드

ur, tr, uo, to = map(int, input().split())
print(56*ur+24*tr+14*uo+6*to)

설명

핵심은 구현 관점에서 Teams from variaous universities compete in ICPC regional contests for tickets to the ICPC World Finals. …를 만족하도록 로직을 구성하는 것입니다.

코드는 입력을 파싱한 뒤 조건 분기와 계산을 순서대로 수행하고, 문제에서 요구한 형식으로 결과를 출력합니다.

경계값과 예외 케이스도 함께 고려해 오답이 나기 쉬운 상황을 방지합니다.



이런 주제는 어떠신가요?

비슷한 난이도와 유형의 문제를 이어서 보면 풀이 감각을 더 빠르게 잡기 좋습니다.

댓글남기기