![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字符串
__Galaxy
,,,,,,,,
展开
-
Manacher O(n) 回文字符串查找算法
虽然在题目中, 这类算法出现得比较少, 但其效率的确很好并且不是很难懂, 所以学一下也总有用得到的时候;下面是一篇不错的博客, 推荐; http://www.open-open.com/lib/view/open1419150233417.html for(; s[i - len[i]] == s[i + len[i]]; len[i]++); 并说明一下, 有些读者认为这句话没有原创 2016-08-12 19:38:18 · 198 阅读 · 0 评论 -
Aho-Corasick automation-KMP
为AC自动机学习的做个准备 一篇kmp好文转载 2017-03-08 22:10:57 · 200 阅读 · 0 评论 -
Aho_Corasick 的一些练习(hdu 2222; Poj 1625; Poj2778; hdu2457; Hdu3247)
其实也没有做很多题,但还是发出来(能骗骗访问量。。。) Hdu 2222 #include <algorithm>#include <iostream>#include <cstring>#include <cstdio>#include <queue>const int SZ = 26;const int MX_N = 1e6 + 10;#define FILL(a, b) mems原创 2017-03-11 22:08:13 · 447 阅读 · 0 评论 -
SCOI2012 喵星球上的点名
题意就不说了, 反正是中文; 正解应该是后缀数组, 但是AC自动机可以强行过, 只是比较慢; 对于询问串建AC自动机, 然后暴力把每个喵星人暴力在树上跑, 然后。。。就没有然后了。#include <bits/stdc++.h>const int mx_n = 2e4 + 10;const int mx_m = 5e4 + 10;const int mx_node = 1e5 + 10;#原创 2017-03-18 21:55:23 · 301 阅读 · 0 评论 -
AC自动机习题集
过了HDU2222就基本入门了开始写。。。。 习题集转载 2017-03-09 21:50:06 · 245 阅读 · 0 评论 -
关于后缀树的入门及简单应用
良心百度, 找到了一篇好文章, 非常详细清楚 后缀树 匠心十年转载 2017-06-07 14:15:12 · 352 阅读 · 0 评论 -
【APIO2014】Palindromes
2014年好像没有回文树, 但是回文树出来之后就变成裸题了#include <algorithm>#include <cstring>#include <cstdio>#include <iostream>#define rep(i, s, t) for(int i = (s), i##E = (t); i <= i##E; ++i)#define dec(i, s, t) for(int原创 2017-06-07 20:56:36 · 322 阅读 · 0 评论