답안 #166207

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166207 2019-12-01T07:07:35 Z boboquack 고장난 휴대전화기 (COCI14_mobitel) Python 3
50 / 50
74 ms 3428 KB
d={
'a':'2',
'b':'22',
'c':'222',
'd':'3',
'e':'33',
'f':'333',
'g':'4',
'h':'44',
'i':'444',
'j':'5',
'k':'55',
'l':'555',
'm':'6',
'n':'66',
'o':'666',
'p':'7',
'q':'77',
'r':'777',
's':'7777',
't':'8',
'u':'88',
'v':'888',
'w':'9',
'x':'99',
'y':'999',
'z':'9999',
}
n=input()
e={i:d[i].replace(d[i][0],str(n.index(d[i][0])//2+1)) for i in d}
s='#'.join(e[i] for i in input())
t=''
for i in range(len(s)):
    if s[i]!='#' or s[i-1]==s[i+1]:
        t+=s[i]
print(t)
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 3360 KB Output is correct
2 Correct 25 ms 3364 KB Output is correct
3 Correct 25 ms 3368 KB Output is correct
4 Correct 25 ms 3360 KB Output is correct
5 Correct 26 ms 3428 KB Output is correct
6 Correct 74 ms 3336 KB Output is correct
7 Correct 27 ms 3292 KB Output is correct
8 Correct 26 ms 3364 KB Output is correct
9 Correct 27 ms 3360 KB Output is correct
10 Correct 26 ms 3356 KB Output is correct