https://www.acmicpc.net/problem/1267
1267번: 핸드폰 요금
동호가 저번 달에 이용한 통화의 개수 N이 주어진다. N은 20보다 작거나 같은 자연수이다. 둘째 줄에 통화 시간 N개가 주어진다. 통화 시간은 10,000보다 작거나 같은 자연수이다.
www.acmicpc.net
내 풀이
31120kb 40ms
# 변수 입력 받기
call = int(input())
num_list = list(map(int, input().split()))
# 영식과 민식의 요금제 총합
y_plan = 0
m_plan = 0
for i in range(call):
y_plan += ((num_list[i]//30)+1) * 10
m_plan += ((num_list[i]//60)+1) * 15
if y_plan < m_plan:
print("Y", y_plan)
elif y_plan == m_plan:
print("Y","M", y_plan)
else:
print("M", m_plan)
'파이썬 알고리즘 연습' 카테고리의 다른 글
[백준 1703번] 생장점 (0) | 2023.12.19 |
---|---|
[백준 1598번] 꼬리를 무는 숫자 나열 (1) | 2023.12.19 |
[백준 1547번] 공 (1) | 2023.12.19 |
[백준 1284번] 집 주소 (0) | 2023.12.18 |
[백준 1085번] 직사각형에서 탈출 (0) | 2023.12.18 |