码迷,mamicode.com
首页 >  
搜索关键字:substrings    ( 383个结果
leetcode--Scramble String
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:其他好文   时间:2014-07-06 13:57:54    阅读次数:155
POJ 1226 Substrings (后缀数组)
题目大意: 问的是m个字符串里,都出现过的子串。子串也可以出现在这个串的逆序串中。 思路分析: 居然wa在全5个 “a” 的数据上。 二分的时候下界不能为0。。 思路大致上是把原串和逆序串全部处理出来,放入str中,然后在每个串中间加一个没有出现过的。 此处注意输入不仅仅是字母。 然后跑一遍后缀数组。 然后用标记计数就好了。 #include #include ...
分类:其他好文   时间:2014-07-06 10:07:36    阅读次数:202
spoj 694 求一个字符串中不同子串的个数
SPOJ Problem Set (classical) 694. Distinct Substrings Problem code: DISUBSTR Given a string, we need to find the total number of its distinct substrings. Input T- number of ...
分类:其他好文   时间:2014-07-03 16:32:42    阅读次数:212
[leetcode] Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.
分类:其他好文   时间:2014-07-02 10:03:09    阅读次数:175
UVA 12718 Dromicpalin Substrings(寻找字符串连续子串的回文)
UVA 12718 Dromicpalin Substrings(寻找字符串连续子串的回文)...
分类:其他好文   时间:2014-07-02 09:45:05    阅读次数:214
SPOJ 694、705 Distinct Substrings 、 New Distinct Substrings (后缀数组)
题目大意: 求串中不同的子串的个数。 思路分析: 子串一定是某一个后缀的前缀。 所以我们把每一个后缀拿出来,分析它有多少个前缀,然后除去它与sa数组中前面那个后缀相同的前缀。 最后也就是 ans = segma (n-sa[i] + height[i]).... #include #include #include #include #define maxn 1...
分类:其他好文   时间:2014-07-02 07:23:21    阅读次数:182
Scramble String
题目 Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great /...
分类:其他好文   时间:2014-06-29 23:16:19    阅读次数:312
CF271D_Good Substrings
给一个原串,以及那些字符是坏的,现在问你可以从原串中取出多少个不同子串,使得其所含的坏字符的个数不超过一个定数。这个题目网上有各种各样的解法。如hash,tire。我说一下我的解法。解法一:后缀自动机dp。f[][]保存到达某个状态,前面已经有的坏字符的个数的时候的字符串数量。这样按照拓扑序列一直递...
分类:其他好文   时间:2014-06-24 14:14:07    阅读次数:169
Scramble String
Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation...
分类:其他好文   时间:2014-06-04 20:11:38    阅读次数:303
LeetCode: Scramble String [87]
【题目】 Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great": great / gr eat / \ / g r e at / ...
分类:其他好文   时间:2014-06-01 09:41:05    阅读次数:196
383条   上一页 1 ... 36 37 38 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!