Palindrome Automata——回文自动机
该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。
Statement
For a string , Timothy defines it as a palindrome if and only if every character index in the string of length satisfies . For example, is a palindrome because , while is not.
Timothy now has a string and wants to divide it into several segments of length . Specifically, he will first take the first character and make it , then take the characters and make it , then take the characters and make it , and so on... Finally, if there are any extra characters, they will be treated as separate segments.
For example, the string will be divided into the following five strings:
- ;
- ;
- ;
- ;
- ;
The strings split from the string are all palindromes.
Timothy wants to know, for the input string , how many of the split strings are palindromes?
Input
Input a line, a string . Its length satisfies , and the string contains only English lowercase letters
Output
Output an integer representing the answer.
Samples
aaababcaacd
5
abacdcaaba
2
Notes
For the first group of examples, they have been described in the question;
For the -nd group of examples, , , , , where and are palindrome strings.
2025 JSUT Collegiate Programming Contest 江苏理工学院新生赛-同步赛
- 状态
- 已结束
- 规则
- ACM/ICPC
- 题目
- 15
- 开始于
- 2025-11-8 12:00
- 结束于
- 2025-11-8 17:00
- 持续时间
- 5 小时
- 主持人
- 参赛人数
- 15