Submission #166207

#TimeUsernameProblemLanguageResultExecution timeMemory
166207boboquackMobitel (COCI14_mobitel)Cpython 3
50 / 50
74 ms3428 KiB
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)
#Verdict Execution timeMemoryGrader output
Fetching results...