Trie树
SindarDawn
QZOIer,FTCer,UESTC ACMer,梦想成为大神的Yuta
展开
-
UVa11732 Strcmp,Anyone?[Trie树]
题意:给定判断方式和字符串,输出字符串两两比较的次数; 分析:如果使用正常的字典树,空间复杂度为4000*1000*26,果断爆,但我静态数组没有爆反而RE了,不知道为什么,可能UVa没有MLE?等会试一下;然后还会超时,因为每个节点都要枚举,是4000*1000*26*26,,不过机智一点应该不会超时?就每次insert顺便求了。所以,采用树的压缩算法(左孩子右兄弟)。 第一次写多叉转原创 2016-10-11 14:07:13 · 393 阅读 · 0 评论 -
LA3942Remember the Word[Trie树]
Neal is very curious about combinatorialproblems, and now here comes a problem about words. Know-ing that Ray has aphotographic memory and this may not trouble him, Neal gives it to Jiejie.SinceJiejie原创 2016-10-11 09:23:13 · 428 阅读 · 0 评论