摘要:
void solve(){ int r=a[1].r; int i=2, mx=0, ans=1; while(r<len){ mx=r; while(a[i].l<=r&&i<=len){ mx=max(mx,a[i].r); i++; } ans++ ; r=mx; } cout<<ans-1< 阅读全文
posted @ 2023-06-30 23:53
towboat
阅读(12)
评论(0)
推荐(0)
摘要:
首先注意 2* n 的长度 mx: 当前匹配到的最大长度 即 [1,mx] id: mx 对应的中心点 pi : s[i] 为中心的回文串的最大长度, pi /2 -1 是半径() #include <iostream> #include <cstring> #include <algorithm> 阅读全文
posted @ 2023-06-30 21:46
towboat
阅读(12)
评论(0)
推荐(0)