这道题估计数据比较水,爆搜就能过
从这道题了解到strstr在随机数据的时候比kmp快。。。。正所谓KMP是一种很好的思想,但不实用
接下来就是了解了一些c里的库函数,一开始找不到求子串的函数,写完后才找到strncpy这个函数可以求子串
还有一点要注意的就是得到第一个结果的时候本来可以直接跳出的,但直接跳出的时候可能会碰到一些特殊数据,所以还是用个max记录最大的长度吧。。(这里WA了好多...
分类:
其他好文 时间:
2015-03-29 12:16:26
阅读次数:
90
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
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
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
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
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
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
给一个长度为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
题目链接:D. A and B and Interesting Substrings题目大意给定26个小写字母的权值,一共26个整数(有正有负)。给定一个小写字母组成的字符串(长度10^5),求有多少长度大于1的子串满足:1)首尾字符相同。2)除了首尾字符外,其他字符的权值和为0。题目分析使用STL...
分类:
其他好文 时间:
2015-03-01 14:27:51
阅读次数:
151
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-02-09 15:31:37
阅读次数:
149