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

11078번 - Banking 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 256 MB133958872.131%

문제

Internet banking sites have a variety of methods to authenticate their users. The methods usually involve passwords or Personal Identification Numbers (PINs) together with a mechanism to verify that a person is attempting to authenticate rather than a computer program.

The Actuarial Commerce Merchant bank has a scheme where, when you login, you are provided with a “pattern word”, containing only upper and lower case letters. You must use this pattern word to extract and sum digits from your PIN as follows.

Letters in the pattern word are to be interpreted as numbers, with a (or A) = 1, b (or B) = 2, ... z (or Z) = 26. A lower case letter specifies a count of digits to extract from the PIN while an upper case letter specifies a counts of digits to be skipped. The letters in the pattern word are processed from left to right resulting in a sequence of extracted digits, which are added together to yield a number. You then enter that number into a field on the web page form to authenticate yourself. For example, if your PIN was 1093373, and the pattern provided to you was aBcA you would extract one digit (namely 1) skip two digits (09), extract 3 digits (337) and then skip 1 digit (3), before totalling the extracted digits (1337) and entering 14 into the field on the web page form.

The bank allows you to have a PIN containing up to 256 digits and they intend to provide a pattern word in which the letters, when interpreted as numbers, sum to the length of the PIN. However, sometimes they get this wrong!

Write a program that reads a PIN and a pattern word and outputs the sum of the digits extracted from the PIN if the pattern is valid or outputs non sequitur if the length of the PIN and the length indicated by the pattern are different.

입력

The input contains a single test case.

The first line of input will contain an n-digit PIN, 6 ≤ n ≤ 256. The second line will contain an m-digit pattern word containing only upper and lower case letters, 1 ≤ m ≤ 256.

출력

The test case will produce one line of output being either the sum of the extracted digits from the PIN if the pattern word is valid or the text non sequitur if the pattern is invalid.

제한

예제 입력 1

092384907653
bGc

예제 출력 1

23

예제 입력 2

092384907653
bGb

예제 출력 2

non sequitur

힌트

출처

ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Western Division > ACM South Pacific Western Division 2015 H번

ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Eastern Division > ACM South Pacific Eastern Division 2015 H번

ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Central Division > ACM South Pacific Central Division 2015 D번

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

출처

대학교 대회

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

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