Algorithm/Baekjoon

백준 단계별로 풀기 7단계 문자열 사용하기 - 다이얼 (5622 문제) Python 2 답안

Bonita SY 2019. 1. 18. 22:49
728x90
반응형

alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

time__ = [3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10]


word = raw_input()

total_time = 0

for w in word:

        index = alphabet.index(w)

        total_time += time__[index]

print total_time

728x90
반응형