![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
nash142857
这个作者很懒,什么都没留下…
展开
-
hdu1251
字典树入门~#include #include typedef struct node { int cnt; struct node *next[26]; } AC; AC * create() { AC *p=(AC *)malloc(sizeof(AC)); p->cnt=1; for(int i=0;i<=25;i++) p->next[i]=NULL; return p;原创 2012-09-19 16:40:25 · 849 阅读 · 0 评论 -
ZOJ1039
字典树+搜索时用dfs#include #include #include #include using namespace std; int T,n,m; char s[110]; vectorvt[9]; struct trie { int cnt; trie * nxt[26]; }; trie * init(int num) { trie * p=new trie; p->cnt=原创 2012-09-24 21:34:59 · 550 阅读 · 0 评论