![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM_hihoCoder
TouchDreamer
这个作者很懒,什么都没留下…
展开
-
hihoCoder #1403 : 后缀数组一·重复旋律
题目分析 后缀数组基础题目,肯定要把height数组找出来,然后从前往后扫一下,每k个需要找一个最小值,这里我用了单调队列优化,队列中一直保存着k个元素的最小元素,但是这里需要之一的一点,每一个height[i]值表示sa[i-1]与sa[i]的最长公共前缀,因此单调队列只用维护k-1个值即可。 #include <cmath> #include <queue> #include <cstdio原创 2016-11-08 18:55:08 · 275 阅读 · 0 评论 -
hihoCoder #1415 : 后缀数组三·重复旋律3
题目分析 将2个串连起来,中间加分隔符’#’,然后直接从头到尾枚举一遍height值,如果前面在一个穿,后面再另一个串,那么很明显这个height值是可以计算的,找出满足这样条件最大的即可。 #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using na原创 2016-11-08 20:26:41 · 385 阅读 · 0 评论