[파이썬][백준 20254번] Site Score
1. 문제Permalink
[Bronze V] Site Score - 20254Permalink
성능 요약Permalink
메모리: 30864 KB, 시간: 72 ms
분류Permalink
사칙연산(arithmetic), 수학(math)
문제 설명Permalink
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. Let
- UR be the number of universities solving at least one problem in the regional contest.
- TR be the number of teams solving at least one problem in the regional contest.
- UO be the number of universities solving at least one problem in TOPC.
- TO be the number of teams solving at least one problem in TOPC.
The site score of 2020 Taipei-Hsinchu regional contest will be 56UR + 24TR + 14UO + 6TO. Please write a program to compute the site score of the 2020 Taipei-Hsinchu regional contest.
입력Permalink
The input has only one line containing four blank-separated positive integers UR, TR, UO, and TO.
출력Permalink
Output the site score of the 2020 Taipei-Hsinchu regional contest.
출처: 백준, https://https://www.acmicpc.net/
2. 해결방법 시간복잡도Permalink
- 단순 코딩 O(1)
3. 문제 해결 및 코드Permalink
Ur, Tr, Uo, To = map(int, input().split()) | |
print(Ur*56 + Tr*24 + Uo*14 + To*6) |
-
주석을 참고하면서 이해를 돕습니다.Permalink
4. 알고리즘 및 해설Permalink
- 각각의 값들을 받은 이후 문제에서 제시한 공식을 사용해서 출력해준다.
- 문제에서 제시한 공식 The site score of 2020 Taipei-Hsinchu regional contest will be 56UR + 24TR + 14UO + 6TO.