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

18206번 - Soft Passwords 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 512 MB125726857.627%

문제

Your favourite social media website is changing their policy on login password validation: a slight error when logging in is now acceptable! In particular, assuming the password you chose when creating the account is S, a password P entered while logging in will be accepted if any of the following conditions are met:

  • P and S are identical;
  • S can be formed from P by prepending a single digit (0–9);
  • S can be formed from P by appending a single digit;
  • S is equal to P after reversing the case of all letters in P.

To reverse the case of a string, replace all uppercase letters with their equivalent lowercase letters, and all lowercase letters with their equivalent uppercase letters, while leaving all other characters the same. For example, the case-reversal of pa55WORD is PA55word.

Any other attempted password P will be rejected. So for example, if S is c0deninja5, then c0deninja will be accepted, but not C0deninja5 or c0deninja51.

Write a program which, given alphanumeric strings S and P, determines whether P should be accepted.

입력

The first line of the input is the string S, the stored password, and the second line of input is the password P that a user has entered while attempting to log in. Each string consists of only digits 0–9, lowercase letters a–z, and uppercase letters A–Z. The strings won’t contain spaces or any other extraneous characters, and will each contain at least one and at most 101 characters.

출력

Print Yes if P should be accepted according to the above rules, and No otherwise.

제한

예제 입력 1

123
123a

예제 출력 1

No

예제 입력 2

abc
ABC

예제 출력 2

Yes

힌트

출처

ICPC > Regionals > North America > Mid-Central Regional > 2019 Mid-Central Regional Programming Contest I번

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

출처

대학교 대회

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

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