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

20350번 - Account Numbers 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB13212110893.103%

문제

Organising programming contests is a lot of work. One of the many tasks, some say the most important one, is to arrange reimbursement for the jury (and other volunteers) for their travel to the contest. In order to obtain their reimbursements, the jury members provide (among other things) their International Bank Account Numbers (IBANs), uniquely identifying their bank accounts. If they make a typo when writing their IBAN, the reimbursement cannot be sent, but fortunately an IBAN contains two check digits that can be used to mitigate such errors. Let us help the contest organisers by verifying that a provided IBAN is correct, so that the reimbursements are not delayed more than necessary.

For those of you who do not know, an IBAN is a string consisting of between 15ドル$ and 34ドル$ upper-case letters and digits. To validate a given IBAN, the following amazing procedure is used.

  1. Move the first four characters to the end of the string.
  2. Replace each letter by digits, where $A = 10,ドル $B = 11,ドル ..., $Z = 35$.
  3. Interpret the resulting string as a decimal number and compute the remainder modulo 97ドル$. An IBAN is valid if and only if the remainder is 1ドル$.

For example, consider the IBAN "NL20INGB0001234567". After performing the first step we get the string "INGB0001234567NL20", and then after replacing letters with digits we get the number 182316110001234567232120ドル$. The remainder of this number modulo 97ドル$ equals 1ドル,ドル so this was indeed a valid IBAN.

입력

The input consists of:

  • One line with a string $s$ (15ドル \leq \mathrm{length}(s) \leq 34$): the IBAN to validate. The IBAN only contains upper case letters and digits.

출력

If the given IBAN is valid, output "correct". Otherwise, output "incorrect".

제한

예제 입력 1

NL20INGB0001234567

예제 출력 1

correct

예제 입력 2

NL20ASNB0001234567

예제 출력 2

incorrect

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2019 연습 세션 PA번

  • 문제를 만든 사람: Jeroen Bransen
(追記) (追記ここまで)

출처

대학교 대회

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

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