atcoder#AGC026C. [AGC026C] String Coloring
[AGC026C] String Coloring
Score : points
Problem Statement
You are given a string of length consisting of lowercase English letters.
There are ways to color each character in red or blue. Among these ways, how many satisfy the following condition?
- The string obtained by reading the characters painted red from left to right is equal to the string obtained by reading the characters painted blue from right to left.
Constraints
- The length of is .
- consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print the number of ways to paint the string that satisfy the condition.
4
cabaacba
4
There are four ways to paint the string, as follows:
- cabaacba
- cabaacba
- cabaacba
- cabaacba
11
mippiisssisssiipsspiim
504
4
abcdefgh
0
18
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
9075135300
The answer may not be representable as a -bit integer.