Common Substrings
Time Limit: 5000MS
Memory Limit: 65536K
Total Submissions: 8471
Accepted: 2798
Description
A substring of a string T is defined as:
T(i, k)=TiTi+...
分类:
编程语言 时间:
2015-08-25 21:57:13
阅读次数:
172
SUBST1 - New Distinct Substrings
no tags
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of test cases. T
Output
For each test case ou...
分类:
编程语言 时间:
2015-08-21 19:27:35
阅读次数:
168
pre[i]第i位数往前走多少位碰到和它相同的数
dp[i]表示长度为i的子串,dp[i]可以由dp[i-1]加上从i到n的pre[i]>i-1的数减去最后一段长度为i-1的断中的不同的数得到....
爆int+有点卡内存....
Substrings
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 3276...
分类:
编程语言 时间:
2015-08-19 00:43:47
阅读次数:
149
DISUBSTR - Distinct Substrings
no tags
Given a string, we need to find the total number of its distinct substrings.
Input
T- number of test cases. T
Each test case consists of one st...
分类:
编程语言 时间:
2015-08-18 22:48:38
阅读次数:
154
题目大意:给你N个串,求出来他们的最大公共子串的长度(子串反过来也算他们的子串)。分析:很久以前就做过这道题,当时是用的strstr做的,不过相同的都是枚举了子串......还是很暴力,希望下次遇到类似的题目我已经掌握高效的方法了。==================================...
分类:
其他好文 时间:
2015-08-15 18:15:59
阅读次数:
97
题意: 求长度大于等于K的公共子串的个数。位置不同就算不同。后缀数组求依次SA LCP, 然后就是统计答案了, 暴力统计n^2复杂度显然不可以, 我们可以利用lcp数组的"部分单调性", 用一个栈,栈中保存小于等于当前lcp的原数组的下标,两次统计, 第一次统计, 按B串统计, 把A串大于等于K的那...
分类:
编程语言 时间:
2015-08-07 22:03:51
阅读次数:
125
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1238
Substrings
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8391 Accepted Submissi...
分类:
其他好文 时间:
2015-08-07 11:09:44
阅读次数:
107
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 ...
分类:
其他好文 时间:
2015-07-25 10:44:04
阅读次数:
128
通道:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2672
分类:
其他好文 时间:
2015-07-24 17:59:06
阅读次数:
1207
题目的意思是,找到各个串的最长子串,输出长度。
我们找到最短的串,枚举这个串的所有子串,需要注意的是,这些子串的逆序也是可以的。
知道了这些,就可以写出代码了。
下面是AC的代码:
#include
#include
using namespace std;
char str[105][105];
int main()
{
char s1[105], s2[105];
int ...
分类:
其他好文 时间:
2015-07-20 23:29:19
阅读次数:
239