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

16301번 - Isomorphic Inversion 다국어

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

문제

Let s be a given string of up to 106 digits. Find the maximal k for which it is possible to partition s into k consecutive contiguous substrings, such that the k parts form a palindrome. More precisely, we say that strings s0, s1, . . . , sk−1 form a palindrome if si = sk−1−i for all 0 ≤ i < k.

In the first sample case, we can split the string 652526 into 4 parts as 6|52|52|6, and these parts together form a palindrome. It turns out that it is impossible to split this input into more than 4 parts while still making sure the parts form a palindrome.

입력

  • A nonempty string of up to 106 digits.

출력

  • Print the maximal value of k on a single line.

제한

예제 입력 1

652526

예제 출력 1

4

예제 입력 2

12121131221

예제 출력 2

7

예제 입력 3

123456789

예제 출력 3

1

예제 입력 4

132594414896459441321

예제 출력 4

9

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2018 Preliminaries I번

  • 문제를 만든 사람: Ragnar Groot Koerkamp
(追記) (追記ここまで)

출처

대학교 대회

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

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