#x1031. CF932G Palindrome Partition
CF932G Palindrome Partition
Palindrome Partition
题面翻译
给定一个串,把串分为偶数段
假设分为了
求,满足 的方案数
题目描述
Given a string , find the number of ways to split to substrings such that if there are substrings in partition, then for all and is even.
Since the number of ways can be large, print it modulo .
输入格式
The only line of input contains a string of even length consisting of lowercase Latin letters.
输出格式
Print one integer, the number of ways of partitioning the string modulo .
样例 #1
样例输入 #1
abcdcdab
样例输出 #1
1
样例 #2
样例输入 #2
abbababababbab
样例输出 #2
3
提示
In the first case, the only way to partition the string is .
In the second case, the string can be partitioned as or or .