Title meaning:
Define a string as \(super\) palindrome string as:< br> \(\bullet\) The string s is a substring of the main string str, namely \(s = str_lstr_{l + 1} \cdots str_r\)
\(\bullet\) string s is a palindrome string
\(\bullet\) string \(str_lstr_{l + 1}…str_{\llcorner (l + r) / 2 \lrcorner}\) is also a palindrome string
\(\cdots n\) of \(super \) The palindrome appeared several times.
Idea:
Build a palindrome tree, and then use it every time you create a new node Hash quickly judge whether it is a \(super\) palindrome string, and then count the palindrome tree.
Code:
#include