随笔分类 -  ACM-Trie字典树

摘要:题解:n个集合,你要进行m个操作。总共有3种操作。第一种,合并两个集合x和y。第二张,把特定的集合里面所有的数字加一。第三种,询问在某个集合里面,对于所有数字对2的k次方取模后,有多少个数字等于x。 思路:我们可以对于每一个节点保存一个lazy标记,这个标记类似于线段树中的lazy标记。每次整个集合 阅读全文
posted @ 2019-09-02 22:40 StarHai 阅读(397) 评论(0) 推荐(0)
摘要:Chip Factory Time Limit: 18000/9000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 6984 Accepted Submission(s): 3129 阅读全文
posted @ 2019-08-06 10:39 StarHai 阅读(261) 评论(0) 推荐(0)
摘要:题目链接: https://odzkskevi.qnssl.com/0c87453efec2747f8e8a573525fd42f9?v=1533651456 题解: 这是一道Trie+BFS的题目; 这是第二次写了 Orz 还是WA好几发; 这一题,我们可以用字典树存已有的单词,在存的时候,记录一 阅读全文
posted @ 2018-08-09 17:08 StarHai 阅读(322) 评论(0) 推荐(0)
摘要:Problem DescriptionIn the modern time, Search engine came into the life of everybody like Google, Baidu, etc.Wiskey also wants to brin... 阅读全文
posted @ 2018-04-13 23:18 StarHai 阅读(282) 评论(0) 推荐(1)
摘要:Neal is very curious about combinatorial problems, and now here comes a problem about words. Knowingthat Ray has a photographic memory... 阅读全文
posted @ 2018-04-13 23:15 StarHai 阅读(216) 评论(0) 推荐(0)
摘要:int trie[1000010][26]; int num[1000010]={0}; int pos = 1;void Insert(char *s) { int i; int c = 0; for(i=0;i<strlen(s);i... 阅读全文
posted @ 2018-04-12 12:53 StarHai 阅读(348) 评论(0) 推荐(0)