Logo
(追記) (追記ここまで)

8345번 - A Cat on a Keyboard 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB196948048.485%

문제

A cat is walking on Ann's computer's keyboard. Ann's keyboard looks as follows:1

Ann is quite sure that the text created by the cat contains a deeper meaning, so she is willing to decode it in order to understand this meaning. She is got an idea to number the rows of the keys on the keyboard with digits from 1 to 5 (the topmost row gets number 1 and the bottommost - number 5) and to change each character in the cat's text with the number of row of the key corresponding to it. There is a chance that some interesting number will be a result of such transformation and that Ann's mathematical skills will help her understand the text's meaning more easily.

Write a program that:

  • reads the cat's text from the standard input,
  • transforms the cat's text to the digital form,
  • writes the result to the standard output.

1A picture taken from http://acm.uva.es/p.

입력

The first and only line of input contains one sequence of at least 1 and at most 500 000 characters. You can assume that the cat did not step on any of the keys: Alt, BackSpace, Control, Enter, Tab.

출력

The first and only line of output should contain a sequence consisting of digits 1, 2, 3, 4, 5, representing the decoded version of the cat's text.

제한

예제 입력 1

KOT-KTO-TOK KOD.

예제 출력 1

3221322122353234

힌트

출처

Contest > Algorithmic Engagements > PA 2008 0-1번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /