# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166207 | boboquack | Mobitel (COCI14_mobitel) | Cpython 3 | 74 ms | 3428 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |