매우 간단하게 풀리는 문제
방법은 다양하지만, list를 사용해서 배열로 처리하였다.
일일이 변수에 각각의 값을 넣어서 print문 안에서 계산을 하는 형식보다 살짝 더 빠르다.
다음과 같은 코드로 나는 만들었다.
1
2
3
4
5
|
num = list(map(int,input().split()))
# print(num[2])
score = 56*num[0] + 24*num[1] + 14*num[2] + 6*num[3]
print(score)
|
cs |
출처: https://www.acmicpc.net/problem/20254
20254번: Site Score
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 para
www.acmicpc.net
'코딩 문제풀이 및 연습 > Python 연습' 카테고리의 다른 글
sys.stdin.readline()을 사용해야하는 이유 ... [백준]15372_A Simple Problem (0) | 2021.07.16 |
---|---|
[백준] 20673_Covid-19 파이썬 (0) | 2021.07.16 |
[백준]13597_Tri-du 파이썬 (0) | 2021.07.16 |
[백준]11367_Report Card Time 파이썬 (str과 int를 space로 나눠서 동시에 입력받기) (0) | 2021.07.16 |
[백준]10093_숫자 파이썬 (0) | 2021.07.16 |