随笔分类 -  数据结构->字典树

摘要:题解 题面太长无法阅读系列…… 这里说的选择改变指的是在下面区间里碰上了一个更长的可匹配的地址,如果可匹配但是匹配长度没有当前的值大,那么不算改变 我们建一个可持久化的trie,查询的时候先在前$a 1$个里找到最长的可以得到的地址 然后再在区间的trie里找到那条链上,如果碰到一个结束点且比我们初 阅读全文
posted @ 2018-08-18 11:13 sigongzi 阅读(184) 评论(0) 推荐(0)
摘要:题解 题目太丧,OJ太没有良心,我永远喜欢LOJ! (TLE报成RE,垃圾洛谷,我永远喜欢LOJ) 好的,平复一下我debug了一上午崩溃的心态= =,写一写这道题的题解 把所有限制去掉,给出一个值,和一堆数种选一个异或起来求最大值,是一个经典的字典树问题,如果去掉了d的限制,我们类似主席树那样求一 阅读全文
posted @ 2018-06-07 11:32 sigongzi 阅读(173) 评论(0) 推荐(0)
摘要:题解 在trie树上开vector记录一下这个前缀出现次数第一次达到某个值的下标,以及记录一下现在这个前缀有多少个 为什么thusc有那么水的题……是为了防我这种cai ji爆零么= = 代码 cpp include include include include include include / 阅读全文
posted @ 2018-05-24 16:10 sigongzi 阅读(229) 评论(0) 推荐(0)
摘要:Farmer John is stuck with another problem while feeding his cows. All of his N (1 ≤ N ≤ 100,000) cows (numbered 1..N) are lined up in front of the bar 阅读全文
posted @ 2017-02-27 15:19 sigongzi 阅读(555) 评论(0) 推荐(0)
摘要:Letter games are popular at home and on television. In one version of the game, every letter has a value, and you collect letters to form one or more 阅读全文
posted @ 2017-02-02 11:37 sigongzi 阅读(512) 评论(0) 推荐(0)
摘要:The cows have developed a new interest in scanning the universe outside their farm with radiotelescopes. Recently, they noticed a very curious microwa 阅读全文
posted @ 2016-12-04 13:43 sigongzi 阅读(362) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2016-08-17 21:52 sigongzi 阅读(6) 评论(0) 推荐(0)