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

13748번 - Periodic Strings 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB101736975.000%

문제

Define a $k$-periodic string as follows:

A string $s$ is $k$-periodic if $|s|,ドル the length of the string, is a multiple of $k$ and, if you chop the string up into $|s|/k$ substrings of length $k,ドル then each of those substrings (except the first) is the same as the previous substring, but with its last character moved to the front.

For example, the following string is 3ドル$-periodic:

abccabbcaabc

The above string breaks up into substrings abc, cab, bca, and abc, and each substring (except the first) is a rotation of the previous substring (abc $\rightarrow$ cab, cab $\rightarrow$ bca, bca $\rightarrow$ abc).

Given a string, determine the smallest $k$ for which the string is $k$-periodic.

입력

Input will be a single line containing a string $s,ドル (1ドル \leq |s| \leq 100$), consisting only of lower-case letters.

출력

Print a single line containing an integer denoting the smallest value of $k$ for which the input string is $k$-periodic.

제한

예제 입력 1

aaaaaaaa

예제 출력 1

1

예제 입력 2

abbaabbaabba

예제 출력 2

2

예제 입력 3

abcdef

예제 출력 3

6

예제 입력 4

abccabbcaabc

예제 출력 4

3

힌트

출처

ICPC > Regionals > North America > Southeast USA Regional > 2016 Southeast USA Regional Programming Contest > Division 1 I번

ICPC > Regionals > North America > Southeast USA Regional > 2016 Southeast USA Regional Programming Contest > Division 2 H번

ICPC > Regionals > North America > Mid-Atlantic Regional > 2016 Mid-Atlantic Regional Programming Contest A번

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

출처

대학교 대회

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

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