Description A substring of a string T is defined as: Given two strings A, B and one integer K, we define S, a set of triples (i, j, k): You are to giv
分类:
编程语言 时间:
2016-03-18 23:20:40
阅读次数:
310
The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed
分类:
其他好文 时间:
2016-02-23 20:31:03
阅读次数:
173
A. Two Substrings 题意:给一个字符串,求是否含有不重叠的子串"AB"和"BA",长度1e5。 题解:看起来很简单,但是一直错,各种考虑不周全,最后只能很蠢的暴力,把所有的AB和BA的位置求出来,能有一对AB和BA不重叠即可。 1 #include <bits/stdc++.h> 2
分类:
其他好文 时间:
2016-02-16 16:34:23
阅读次数:
214
DescriptionYou are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse ca...
分类:
其他好文 时间:
2016-01-27 12:31:22
阅读次数:
172
题目链接求一个字符串中不相同的子串的个数。子串的总数是(n+1)*n/2, 减去height[i]就可以。#include #include #include #include #include #include #include #include #include #include #includ...
分类:
编程语言 时间:
2016-01-04 11:40:17
阅读次数:
219
题目: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 representa...
分类:
其他好文 时间:
2016-01-04 08:55:51
阅读次数:
208
题意:已知26个小写字母有各自的权值(正,负,或0)现在给出一个字符串,长度#include #include #include #include #include #include #define LL long long#define fir first#define sec secondusi...
分类:
其他好文 时间:
2015-12-18 06:50:16
阅读次数:
124
Common SubstringsTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 8748Accepted: 2899DescriptionA substrin...
分类:
编程语言 时间:
2015-11-29 19:33:16
阅读次数:
244
字串处理操作,用到了stl的排序和去重#include #include #include #include #include #include using namespace std;int fib[]={1,2,3,5,8,13,21,34,55,89};vectorsub;int main()...
分类:
其他好文 时间:
2015-11-20 16:49:03
阅读次数:
113
题目大意:给一个字符串S,令F(x)表示S的所有长度为x的子串中,出现次数的最大值。F(1)..F(Length(S))建出SAM, 然后求出Right, 求Right可以按拓扑序dp..Right就是某个点到结束状态的路径数, parent树上last的那一条链都是结束状态...然后用Right去...
分类:
其他好文 时间:
2015-11-16 22:44:14
阅读次数:
234