
Trie 树 字典树
YDYKL
这个作者很懒,什么都没留下…
展开
-
POJ 3630
问给你几个号码中是否有某个号码是其它号码的前缀开始用动态Trie树,果断TLE静态加排序就过了 这是参照别人的代码写的静态Trie树#include#include#includeusing namespace std;struct node{ int next[10];}tre原创 2011-07-20 09:53:23 · 476 阅读 · 0 评论 -
HDU 1251 基础的Trie树(字典树)
#include#include#includetypedef struct node{ int cnt; node *next[26];}T,*Tree;Tree root;void Insert(char a[]){ int i,j; Tree p=root,NewNode;原创 2011-07-19 23:11:19 · 412 阅读 · 0 评论 -
POJ 1204
http://poj.org/problem?id=1204 #include #include #define M 1010 char ss[M][M]; char str[M*2]; int L,C,W; int tot; int len[M]; int原创 2011-07-22 22:44:14 · 675 阅读 · 0 评论