码迷,mamicode.com
首页 >  
搜索关键字:poj1226 substrings    ( 386个结果
SPOJ694--- DISUBSTR - Distinct Substrings(后缀数组)
Given a string, we need to find the total number of its distinct substrings. InputT- number of test cases. T<=20; Each test case consists of one string, whose length is <= 1000 OutputFor each test c...
分类:编程语言   时间:2015-03-31 22:31:39    阅读次数:163
【spoj705】 Distinct Substrings
【题目描述】给定一个字符串,计算其不同的子串个数。【输入格式】一行一个仅包含大写字母的字符串,长度=n或者所有后缀的排名都不同。 然后正常情况下k增加logN次,每次如果用计数排序只要O(N),一共O(NlogN)。 但是不会写计数排序啊QAQ。。所以用快排好了。。多加一个log,一般不会被卡的.....
分类:其他好文   时间:2015-03-30 22:58:49    阅读次数:277
POJ 1226 Substrings
这道题估计数据比较水,爆搜就能过 从这道题了解到strstr在随机数据的时候比kmp快。。。。正所谓KMP是一种很好的思想,但不实用 接下来就是了解了一些c里的库函数,一开始找不到求子串的函数,写完后才找到strncpy这个函数可以求子串 还有一点要注意的就是得到第一个结果的时候本来可以直接跳出的,但直接跳出的时候可能会碰到一些特殊数据,所以还是用个max记录最大的长度吧。。(这里WA了好多...
分类:其他好文   时间:2015-03-29 12:16:26    阅读次数:90
1093. Count PAT's (25)想法题吧,算是排列组合吧
1093. Count PAT's (25) 时间限制 120 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CAO, Peng The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th,...
分类:其他好文   时间:2015-03-15 09:37:43    阅读次数:1024
LeetCode-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-03-15 00:36:38    阅读次数:159
A1093. Count PAT's (25)
The stringAPPAPTcontains twoPAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by ...
分类:其他好文   时间:2015-03-14 23:04:31    阅读次数:405
[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...
分类:其他好文   时间:2015-03-06 16:15:45    阅读次数:149
MITx: 6.00.1x Alphabetical Substrings (python)
Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then y...
分类:编程语言   时间:2015-03-03 22:17:49    阅读次数:805
MITx: 6.00.1x Alphabetical Substrings (python)
Assume s is a string of lower case characters.Write a program that prints the longest substring of s in which the letters occur in alphabetical order....
分类:编程语言   时间:2015-03-03 18:11:29    阅读次数:376
Codeforces Round #294 Div2 D(A and B and Interesting Substrings)
给一个长度为N的字符串S,字符集是[a,z],每个字符都有一个权值Vi,求有多少个子串subS满足以下条件: 1. |subS|>=2 2. subS[0]=subS[|subS|?1] 3. ∑|subS|?2i=1Vi=0...
分类:其他好文   时间:2015-03-01 21:05:27    阅读次数:207
386条   上一页 1 ... 30 31 32 33 34 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!