아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Reversibly Cyclic Strings

시간 제한1초메모리 제한1024 MB

요약
문자열 s의 모든 진부분 문자열 t에 대해 t의 뒤집은 문자열이 s의 어떤 회전에서 부분 문자열로 나타나는지 판정합니다.
난이도

보통10점 중 4점

유형
문자열, 문자열 매칭, 완전 탐색
정답자
아직 제출이 없습니다

문제

A string tt is a Cyclic Substring of a string ss if there is some rotation of ss such that tt is a substring of that rotation of ss.

For example, if ss is fatcat, then atc and atf are both Cyclic Substrings of ss. However, act is not a Cyclic Substring of ss.

A string ss is Internally Reversibly Cyclic if, for every proper substring tt of ss, the reverse of tt is a Cyclic Substring of ss.

Given a string, determine if it is Internally Reversibly Cyclic.

입력

The single line of input contains a string ss (1≤∣s∣≤1,0001 \le |s| \le 1{,}000, s∈a−z\*s \in \\{\texttt{a}-\texttt{z}\\}^\*)

출력

Output a single integer, which is 11 if ss is Internally Reversibly Cyclic, 00 otherwise.

예제2

  1. 예제 1

    입력
    ccca
    
    예상 출력
    1
    
  2. 예제 2

    입력
    eeaafbddfaa
    
    예상 출력
    0