随笔分类 - 数据结构—字典树
摘要:题意 一颗n(2≤n≤105)个结点的树,树上的每条边有一个边权$w(1\le w b(x); for (int i = 19; ~i; i) { if (!a[root][b[i]]) a[root][b[i]] = ++tot; root = a[root][b[i]]; }
阅读全文
摘要:1.建一颗字典树,然后依次查找 2.要delete,因为new的关系。 3.可以先把这道题做了:Xor Sum HDU - 4825
阅读全文
摘要:Problem Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the p
阅读全文
摘要:Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一
阅读全文
![](https://images.cnblogs.com/cnblogs_com/zgglj-com/1682556/o_200327152908zg.jpg)