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

24606번 - Double Password 다국어

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

문제

A computer at ICPC headquarters is protected by a four-digit password---in order to log in, you normally need to guess the four digits exactly. However, the programmer who implemented the password check left a backdoor in the computer---there is a second four-digit password. If the programmer enters a four-digit sequence, and for each digit position the digit entered matches at least one of the two passwords in that same position, then that four-digit sequence will log the programmer into the computer.

Given the two passwords, count the number of distinct four-digit sequences that can be entered to log into the computer.

입력

The input consists of exactly two lines. Each of the two lines contains a string $s$ ($|s| = 4,ドル $s \in$ {0-9}*). These are the two passwords.

출력

Output a single integer, which is the number of distinct four-digit sequences that will log the programmer into the system.

제한

예제 입력 1

1111
1234

예제 출력 1

8

예제 입력 2

2718
2718

예제 출력 2

1

힌트

출처

ICPC > Regionals > North America > Pacific Northwest Regional > 2021 ICPC Pacific Northwest Region > Division 2 R번

ICPC > Regionals > North America > South Central USA Regional > 2021 South Central USA Regional Contest > Division 2 E번

ICPC > Regionals > North America > Northeast North America Regional > 2021 Northeast North America Regional Contest A번

ICPC > Regionals > North America > Southeast USA Regional > 2021 Southeast USA Regional Programming Contest > Division 2 E번

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

출처

대학교 대회

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

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