![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
FAUX123455
这个作者很懒,什么都没留下…
展开
-
你真的会加法吗?(字典树)
int n,k,q; struct tree { tree *next[12]; tree() { memset(next,NULL,sizeof(next)); } }*root; void add(char *s) { tree *p=root,*q; for(int i=0;i<10;i++) { int id=s[i]-'0'; if(p->next[id]==NULL) .原创 2021-08-21 15:29:21 · 97 阅读 · 1 评论 -
字典树板子题
1.C - 统计难题 HDU - 1251 https://vjudge.net/contest/446782#problem/C //字典树增删查板子 struct tree { tree *next[26]; int flag; tree() { flag=1; memset(next,NULL,sizeof(next)); } }*root; void add(char *s) { int len=strlen(s);原创 2021-08-20 16:16:57 · 73 阅读 · 0 评论