码迷,mamicode.com
首页 >  
搜索关键字:poj1226 substrings    ( 386个结果
spoj 694 Distinct Substrings(后缀数组)
题目:求一个字符串中所有不同子串个数 后缀数组经典题,每一个子串一定是某个后缀的前缀,那么问题便等价于求所有后缀之间的不相同的前缀个数。我们按sa的顺序来考虑,当加入sa[k]的时候,sa[k]这个后缀的长度为n-sa[k]-1,那么便有n-sa[k]-1个前缀,但是由heigh数组可知sa[k]与sa[k-1]有height[k]个前缀是相同的,所以要除去。 注意的是这道题题意有点坑,一开始...
分类:编程语言   时间:2015-07-16 22:27:50    阅读次数:136
[leedcode 87] 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...
分类:其他好文   时间:2015-07-16 00:36:56    阅读次数:151
hdu4455 dp
http://acm.hdu.edu.cn/showproblem.php?pid=4455 Substrings Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2229    Accepted Submission(s...
分类:其他好文   时间:2015-07-04 16:47:53    阅读次数:121
CodeForces 550A Two Substrings(模拟)
【题目链接】click here~~  【题目大意】:  You are given string s. Your task is to determine if the given string s contains two non-overlapping substrings “AB” and “BA” (the substrings can go in any order).  Inp...
分类:其他好文   时间:2015-06-27 16:44:19    阅读次数:145
Substrings(hd1238)
SubstringsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8183Accepted Submission(s): 3752Problem ...
分类:其他好文   时间:2015-06-23 15:01:42    阅读次数:142
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 possib...
分类:其他好文   时间:2015-06-16 16:08:21    阅读次数:120
【套题】Codeforces#306(div2)[A-C]
A. Two Substrings 题意:问一个字符串中是否同时存在AB和BA,其中AB和BA不能共用同一个B或A。 题解:扫一遍即可。可以考虑如下策略:先找AB,然后从B后的位置继续找BA;再另按BA-AB的顺序找一遍即可。复杂度O(n)O(n)。窝的代码则直接暴力出所有的AB和BA位置,只要出现不重叠的两个就OKOK~数据不大,随便搞。 参考代码: #include <bits/stdc++.h...
分类:其他好文   时间:2015-06-11 09:34:23    阅读次数:263
CodeForces 550A Two Substrings(模拟)
【题目链接】click here~~ 【题目大意】: You are given string s. Your task is to determine if the given string s contains two non-overlapping substrings “AB” and “BA” (the substrings can go in any order). Input...
分类:其他好文   时间:2015-06-09 17:24:38    阅读次数:105
Codeforces550A:Two Substrings
You are given string s. Your task is to determine if the given string s contains two non-overlapping substrings "AB" and "BA" (the substrings can go in any order). Input The only line of...
分类:其他好文   时间:2015-06-09 17:21:51    阅读次数:184
天题系列: 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 representat...
分类:其他好文   时间:2015-06-09 06:13:42    阅读次数:93
386条   上一页 1 ... 26 27 28 29 30 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!