字符串
OceanLight
xxxx
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1247 字典树 tire树 (简单)
找出所有的能够由其它的两个字符串组成的字符串. 可以先建起字典树,然后对每一个单词 枚举拆分。 #include #include #include using namespace std; char s[50010][50]; struct node { int num; node * next[26]; } ; node *root; void trie(){原创 2012-12-01 16:11:08 · 622 阅读 · 0 评论 -
hdu 1251 字典树的水题
字典树的水题 #include #include #include using namespace std; struct node { int num ; node *next[26]; } ; node * root; void trie(){ int i,j; root = new node; root->num = 0; for(int i原创 2012-12-01 16:15:50 · 560 阅读 · 0 评论 -
AC 自动机 水题 hdu 3065
AC自动机 : AC自动机算法分为3步:构造一棵Trie树,构造失败指针和模式匹配过程。 在学习 AC 自动机 之前 , 一般应先学会 字典树 (也就是 tire树 ) 和 KMP 算法 (fail指针的构造 就是这个思想)。 用模拟指针实现的AC自动机 #include #include #include #include using namespace std; const原创 2012-12-01 16:21:20 · 574 阅读 · 0 评论 -
hdu 2222 AC自动机 。。
#include #include #include #include using namespace std; const int MAXK = 26; const int MAXN = 500010 ; const int A = 'a'; struct node { node * fail ; node * next[MAXK]; int count原创 2012-12-01 16:25:03 · 527 阅读 · 0 评论
分享