![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
奈何桥边摆地摊
终是没等到你赠的那握月光.
展开
-
AC自动机(多模式串匹配)
AC自动机模板题链接 #include <bits/stdc++.h> using namespace std; class Aho_Corasick { public: Aho_Corasick() { root = new Node(); } /*存储结构:Trie树*/ void insert(const char* word) { Node* tmp = root; for (int i = 0; i < strlen(word); i++) {原创 2020-08-12 16:33:06 · 159 阅读 · 0 评论 -
最长回文子串( Manacher 算法)
最长回文子串( Manacher 算法) 例题链接 时间复杂度:O(n) #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; const int N = 2000010; int n, m, Case; char s[N], str[N]; //s存储原字符串,str存储处理后的字符串 int p[N]; //原创 2020-08-12 13:15:35 · 106 阅读 · 0 评论