Description
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given ...
分类:
编程语言 时间:
2015-06-08 15:03:25
阅读次数:
125
Description
A substring of a string T is defined as:
T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.
Given two strings A, B and one integer K, we define S, a set of triples (i, j, k):
S = {(i, j, ...
分类:
编程语言 时间:
2015-06-07 23:41:18
阅读次数:
391
Two Substrings题意:问是否存在不重叠的串AB和BA。思路:注意ABABA、BABAB这两种情况都应该是YES。所以可以找第一个AB,最后一个BA,如果两者不重叠(即两者不是ABA和BAB这样)可以确保一定是YES,同样如果找第一个BA和最后一个AB可以不重叠一样也是YES。在pytho...
分类:
其他好文 时间:
2015-06-06 23:25:23
阅读次数:
175
A. Two SubstringsYou are given strings. Your task is to determine if the given stringscontains two non-overlapping substrings "AB" and "BA" (the subst...
分类:
其他好文 时间:
2015-06-06 11:53:46
阅读次数:
251
题目传送门 1 /* 2 水题:遍历一边先找AB,再BA,再遍历一边先找BA,再AB,两种情况满足一种就YES 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11...
分类:
其他好文 时间:
2015-06-05 19:33:20
阅读次数:
111
You are given strings. Your task is to determine if the given stringscontains two non-overlapping substrings "AB" and "BA" (the substrings can go in a...
分类:
其他好文 时间:
2015-06-05 19:17:00
阅读次数:
113
A. Two Substrings给出一个字符串,如果同存在不重叠的AB和BA,输出YES,否则输出NO先找AB再找BA,是不行的,比如BABCCCAB还有一种方法是,先找到AB,在加一层循环,找BA显然这样是超时的。但我们发现,如果第一个AB,找不到对应BA,第二个AB也找不到对应BA,那么一定是...
分类:
其他好文 时间:
2015-06-05 17:11:24
阅读次数:
98
题目: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-03 15:33:00
阅读次数:
168
POJ1226 Substrings,字符串,暴力,最长公共子串
You are given a number of case-sensitive strings of alphabetic characters, find the largest string X, such that either X, or its inverse can be found as a substring of any of the given strings....
分类:
其他好文 时间:
2015-06-01 22:48:24
阅读次数:
223
Description
The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "a...
分类:
编程语言 时间:
2015-06-01 22:36:06
阅读次数:
262