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

21143번 - Magic Trick 다국어

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

문제

You are performing a magic trick with a special deck of cards.

You lay out the cards in a row from left to right, face up. Each card has a lower-case letter on it. Two cards with the same letter are indistinguishable. You select an audience member to perform an operation on the cards. You will not see what operation they perform.

The audience member can do one of two things—they can either select any two cards and swap them, or leave the cards untouched.

In order for the trick to succeed, you must correctly guess what the audience member did—either you guess that the audience member did nothing, or you point at the two cards the audience member swapped.

Given a string that represents the initial arrangement of the cards, can you guarantee that you will always be able to guess the audience member’s operation correctly, no matter what operation they perform?

입력

The input consists of a single line containing the string $s$ (1ドル \le |s| \le 50$), which represents the initial arrangement of the cards, in the order they appear in the row. The string contains only lower-case letters (‘a’–‘z’).

출력

Output a single line with 1ドル$ if you can guarantee that you will always be able to guess the audience member’s operation correctly, or 0ドル$ otherwise.

제한

예제 입력 1

robust

예제 출력 1

1

예제 입력 2

icpc

예제 출력 2

0

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2020 Southeast USA Regional Programming Contest J번

ICPC > Regionals > North America > Pacific Northwest Regional > 2020 ICPC Pacific Northwest Region > Division 2 AC번

ICPC > Regionals > North America > South Central USA Regional > 2020 South Central USA Regional Contest J번

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

출처

대학교 대회

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

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