HDU 3948-The Number of Palindromes-回文自动机

题意: 给出一个字符串,求其不相同回文子串的个数 思路: 回文自动机模板题,因为回文自动机中每个新建的结点就表示一个回文子串,各个结点都不相同 所以不同回文子串个数就是回文自动机中新增结点个数,直接输出即可 代码: #include <bits/stdc++.h> using namespace std; const int MAXN = 100005 ; const int N = 26 ;
相关文章
相关标签/搜索