Algorithm/๋ฐฑ์ค€

[๋ฐฑ์ค€] 5622 ๋‹ค์ด์–ผ (ํŒŒ์ด์ฌ/python)

chjcoder 2023. 6. 19. 22:27

๐ŸŽˆ๋ฌธ์ œ

https://www.acmicpc.net/problem/5622

 

๐ŸŽ์–ด๋–ค ์•Œ๊ณ ๋ฆฌ์ฆ˜?

1. ๋‹จ์ˆœ ๊ตฌํ˜„!

๐Ÿ’ป์ฝ”๋“œ

word = input()
alphabet = ['ABC','DEF','GHI','JKL','MNO','PQRS','TUV','WXYZ']
time = 0

for i in range(len(word)):
  for j in alphabet:
    if word[i] in j:
      time += alphabet.index(j) + 3

print(time)