![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
字典树
largecub233
这个作者很懒,什么都没留下…
展开
-
trie-洛谷P2580 于是他错误的点名开始了
https://www.luogu.org/problem/show?pid=2580 字典树trie; 感觉所有树里面字典树最好理解了; 但是操作直接到指针; 这个我调了40min; 感觉和p转c++时差不多,很傻逼的错误调好久; 字典树感觉不用讲什么 还有 a->b==(*a).b#include<iostream> #include<cstdio> #include<cstri原创 2017-03-14 22:56:09 · 491 阅读 · 1 评论 -
trie-51nod1526 分配笔名
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1526 狗题; 卡我内存6mb; 所以我只有95分; 好像用指针,用结构体,内存会大; 唉~ 这道题目,我们先用真名去建树; 对于每一个名字,我们从root更新下去; 走到一个点,这个点的v就++;原创 2017-03-15 14:52:36 · 461 阅读 · 0 评论 -
trie-bzoj1954-poj3764-The xor-longest Path
http://poj.org/problem?id=3764 转载 http://blog.csdn.net/sdj222555/article/details/43032031 题意,一颗树,每个边有个值,在树上找一条简单路径,使得这条路径上的边权异或值最大 把这题模型转换一下, 对于任意一条路径的异或,表示为f(u, v) 则f(u, v) = f(1, u) ^ f(1,转载 2017-03-16 00:01:28 · 320 阅读 · 0 评论 -
trie-[HNOI2004]L语言
https://www.luogu.org/problem/show?pid=2292#sub 其实这道题思很简单; 如果0~j可以被解释; 那么我看看从j+1到m有没有可以解释的;#include<iostream> #include<cstdio> #include<cstring> #define Ll long long #define N 30 using namespace std原创 2017-03-17 09:39:20 · 624 阅读 · 0 评论