← Back to List

8345번: A Cat on a Keyboard ↗

Solutions

Python 3
642 B | 642 chars
import sys
from math import sqrt, pi, sin, factorial, ceil, floor

BLANK = " "

inp = input
# inp = lambda : sys.stdin.readline()[:-1].strip()
mii = lambda x = BLANK : [*map(int,inp().split(x))]
mfi = lambda x = BLANK : [*map(float,inp().split(x))]
ii = lambda : int(inp())
fi = lambda : float(inp())
p = print


def solve():
  l = [
    "`1234567890-=",
    "QWERTYUIOP[]\\",
    "ASDFGHJKL;'",
    "ZXCVBNM,./",
    " ",
  ]
  
  s = input()
  
  ans = ""
  for i in s:
    for idx in range(5):
      if i in l[idx]:
        ans += str(idx + 1)
  p(ans)

  
if __name__ == "__main__":
  tc = 1

  for t in range(1, tc+1):
    ret = solve()