字符串string

字符串string,第1张

字符串string

回文串:o(n)

#include
#include
using namespace std;
#define int long long
const int maxn=1e5+5;
int p[maxn];//以i为中心回文串半径,p[i]-1为原字符串i为中心最大回文串长度
signed main()
{
    string s="";
    string now;cin>>now;
    s+="?";
    for(int i=0;imx)
        {
            id=i;
            mx=p[i]+i;
        }
    }
}

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5718936.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存