版本比较
trie字典树总结
正文
增加 12 行删除 12 行
23 行未改动242526272828293031327 行未改动404142434444454647484950515252535455565657585960606162636464656667686869707172727374757676777879808081828384848586878812 行未改动10110210310410510510610710810914 行未改动23 行未改动真的真的很不错,强烈推荐,我就是按着这个来做的。
大概对我做的题目做个简要题解:(按照题单顺序讲解)
1.[P2580 于是他错误的点名开始了](https://www.luogu.com.cn/problem/P2580) 1.[P2580 于是他错误的点名开始了](https://www.luogu.com.cn/problem/P2580)
板子,不说
2.[SP4033 PHONELST - Phone List](https://www.luogu.com.cn/problem/SP4033)7 行未改动4.[HDU 4825 Xor Sum](https://www.luogu.com.cn/problem/U109895)
直接找一个与询问异或最大的即可。
5.[HDU 5536 Chip Factory](https://www.luogu.com.cn/problem/U109897) 5.[HDU 5536 Chip Factory](https://www.luogu.com.cn/problem/U109897)
暴力枚举i,j找最大的k,注意到i,j,k三个不相等,所以在找k前得把i,j删除。删除就是路径上的cnt-1即可。
6.[Codechef REBXOR Nikitosh and xor](https://www.luogu.com.cn/problem/U109923)
前面往后找一遍,后面往前找一遍,然后路上取max。
7.[P3879 TJOI2010 阅读理解](https://www.luogu.com.cn/problem/P3879) 7.[P3879 TJOI2010 阅读理解](https://www.luogu.com.cn/problem/P3879)
常规建trie,但是如果手算空间发现会炸,不建议直接少开1/10之类的,黑科技就是询问建trie,这样就没问题了。
8.[ HNOI2004 L 语言](https://www.luogu.com.cn/problem/P229) 8.[ HNOI2004 L 语言](https://www.luogu.com.cn/problem/P229)
暴力优化,跟trie的关系不大,如果只练习trie可以跳。
9.[P3294 SCOI2016 背单词](https://www.luogu.com.cn/problem/P3294) 9.[P3294 SCOI2016 背单词](https://www.luogu.com.cn/problem/P3294)
题目描述差评,读懂后就发现是由3操作,然后反着建trie,然后就是人类智慧贪心,对于一个节点,先走小的子树。
10.[P5768 CQOI2016 路由表](https://www.luogu.com.cn/problem/P5768) 10.[P5768 CQOI2016 路由表](https://www.luogu.com.cn/problem/P5768)
题目没看懂,一会晚上补了。
11.[P2922 USACO08DEC Secret Message G](https://www.luogu.com.cn/problem/P2922) 11.[P2922 USACO08DEC Secret Message G](https://www.luogu.com.cn/problem/P2922)
路上加1,末尾加1,注意跟询问串相同的串是否加多了。
12.[P2536 AHOI2005 病毒检测](https://www.luogu.com.cn/problem/P2536) 12.[P2536 AHOI2005 病毒检测](https://www.luogu.com.cn/problem/P2536)
待补。
13.[P3065 USACO12DEC First! G](https://www.luogu.com.cn/problem/P3065) 13.[P3065 USACO12DEC First! G](https://www.luogu.com.cn/problem/P3065)
妙妙题,对于每一位跟后面的建有向边,如果有环的话就不行。
14.[P3732 HAOI2017 供给侧改革](https://www.luogu.com.cn/problem/P3732) 14.[P3732 HAOI2017 供给侧改革](https://www.luogu.com.cn/problem/P3732)
待补。
15.[P4407 JSOI2009 电子字典](https://www.luogu.com.cn/problem/P4407) 15.[P4407 JSOI2009 电子字典](https://www.luogu.com.cn/problem/P4407)
暴力询问每种串情况即可,就是暴力。
16.[CF817E Choosing The Commander](https://www.luogu.com.cn/problem/CF817E)12 行未改动我发现,出trie的难题很多就是从已有的题目加难度变成一道全新的困难的题目。
举个例子
5.[HDU 5536 Chip Factory](https://www.luogu.com.cn/problem/U109897) 5.[HDU 5536 Chip Factory](https://www.luogu.com.cn/problem/U109897)
本身很简单对吧。如果把序列加强成树怎么做?作者思考了很久没有结果。
后来发现14 行未改动