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

25870번 - Parity of Strings 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB46838135382.864%

문제

The historical battle between numbers and strings has taken a new twist: numbers are bragging on their categorization of being “even” or “odd” and strings lacking such feature. But don’t count strings out yet!

A string is considered “even” if every letter in the string appears an even number of times; the string is “odd” if every letter in the string appears an odd number of times.

Given a string, determine whether the string is even, odd, or neither.

입력

The input consists of a single line, starting in column 1, not exceeding column 70, and containing only the lowercase letters (at least one letter).

출력

The output consists of a single integer: print 0 (zero) if the string is even, 1 (one) if the string is odd, or 2 if the string is not even and is not odd (i.e., it is neither).

제한

예제 입력 1

coachessoaehwwwwww

예제 출력 1

0

예제 입력 2

coachesarefun

예제 출력 2

2

예제 입력 3

coachesc

예제 출력 3

1

힌트

출처

University > University of Central Florida > 2018 Local Programming Contest 2번

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

출처

대학교 대회

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

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