码迷,mamicode.com
首页 >  
搜索关键字:后缀数组    ( 1340个结果
[bzoj1031][JSOI2007]字符加密Cipher
显然把原串复制一遍,然后排序长度为len的各个后缀就行了。 我只是突然想试试hash。。。代码量不到1k而且似乎竟然比写得不是很好的后缀数组快?自然溢出大法好... 1 #include<cstdio> 2 #include<iostream> 3 #include<cstring> 4 #incl
分类:Web程序   时间:2016-02-10 15:22:28    阅读次数:253
【HDOJ】3553 Just a String
后缀数组加二分可解。 1 /* 3553 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <set> 8 #include
分类:其他好文   时间:2016-02-05 11:30:05    阅读次数:174
【HDOJ】4426 Palindromic Substring
综合性很强的一道题目,结合manacher,后缀数组,哈希,RMQ,二分可解。基本思路是通过manacher可以找到所有可能的回文串,哈希去重,后缀数组二分找数目。最后暴力求解。需要注意kth需要为__int64。 1 /* 4426 */ 2 #include <iostream> 3 #incl
分类:其他好文   时间:2016-02-05 01:49:59    阅读次数:177
【HDOJ】3948 The Number of Palindromes
后缀数组求不重复回文子串数目。注意dp数组。 1 /* 3948 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <set
分类:其他好文   时间:2016-02-04 01:09:17    阅读次数:285
【HDOJ】4691 Front compression
后缀数组基础题目,dc3解。 1 /* 4691 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <set> 8 #inc
分类:其他好文   时间:2016-02-03 22:34:03    阅读次数:280
【POJ】3294 Life Forms
后缀数组。 1 /* 3294 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <set> 8 #include <sta
分类:其他好文   时间:2016-02-03 21:40:36    阅读次数:364
【HDOJ】2459 Maximum repetition substring
后缀数组+RMQ。 1 /* 2459 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <set> 8 #include
分类:其他好文   时间:2016-02-03 13:31:45    阅读次数:201
常用算法复习
字符串匹配: 有限自动机 KMP 后缀数组 前缀数组 动态规划 NPC 商旅问题近似算法 最小生产树 LK算法
分类:编程语言   时间:2016-02-03 11:41:03    阅读次数:131
【HDOJ】2890 Longest Repeated subsequence
后缀数组的应用。和男人八题那个后缀数组差不多。 1 /* 2890 */ 2 #include <iostream> 3 #include <sstream> 4 #include <string> 5 #include <map> 6 #include <queue> 7 #include <se
分类:其他好文   时间:2016-02-03 01:52:15    阅读次数:215
BZOJ 1396: 识别子串( 后缀数组 + 线段树 )
这道题各位大神好像都是用后缀自动机做的?.....蒟蒻就秀秀智商写一写后缀数组解法.....求出Height数组后, 我们枚举每一位当做子串的开头.如上图(x, y是height值), Heights数组中相邻的3个后缀, 假如我们枚举s2的第一个字符为开头, 那我们发现, 长度至少为len = m
分类:编程语言   时间:2016-02-02 17:54:59    阅读次数:301
1340条   上一页 1 ... 80 81 82 83 84 ... 134 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!