Palindrome Partitioning IIGiven a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a p...
分类:
其他好文 时间:
2014-08-07 21:54:30
阅读次数:
222
echo() 函数定义和用法echo() 函数输出一个或多个字符串。语法echo(strings)参数描述strings必需。一个或多个要发送到输出的字符串。提示和注释注释:echo() 实际上不是一个函数,因此您无需对其使用括号。不过,如果您希望向 echo() 传递一个或多个参数,那么使用括号会...
分类:
其他好文 时间:
2014-08-06 22:01:12
阅读次数:
232
题目链接:http://poj.org/problem?id=2406题目大意:如果n%(n-next[n])==0,则存在重复连续子串,长度为n-next[n]。例如: a b a b a bnext:-1 0 0 1 2 3 4next[n]==4,代表着,前缀abab与后缀abab相等的最.....
分类:
其他好文 时间:
2014-08-06 17:59:31
阅读次数:
186
这题跟HDU 1358 Period (KMP)
差不多,稍微修改代码就行了。
关于KMP的更多知识,请关注从头到尾彻底理解KMP(2014年8月4日版)
。
#include
#include
int n,next[1000000];
char p[1000000];
void getnext()
{
int k=0,j=1;
next[0]=-1;next[1]=0;
...
分类:
其他好文 时间:
2014-08-06 14:48:01
阅读次数:
204
bzero:原型:void bzero(void *s, int n); 功能:置字节字符串s的前n个字节为零且包括‘\0’。 说明:bzero无返回值,并且使用strings.h头文件,strings.h曾经是posix标准的一部分,但是在POSIX.1-2001标准里面,这些函数被标记为...
分类:
其他好文 时间:
2014-08-06 14:11:21
阅读次数:
233
使用typedef语句定义数组类型 1. 一维数组类型的定义格式 typedef []; 例如: (1) typedef int vector[10]; (2) typedef char strings[80]; (3) typedef short int array[N]; 第一条语句定义了一个元...
分类:
其他好文 时间:
2014-08-06 01:46:10
阅读次数:
256
Description
Let x and y be two strings over some finite alphabet A. We would like to transform
x into y allowing only operations given below:
Deletion: a letter in x is missing in y at a corr...
分类:
其他好文 时间:
2014-08-05 19:32:50
阅读次数:
247
Surprising Strings Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionThe D-pairs of a string of letters a...
分类:
其他好文 时间:
2014-08-05 18:32:29
阅读次数:
196
Common WordsLet's continue examining words. You are given two string with words separated by commas. Try to find what is common between these strings....
分类:
其他好文 时间:
2014-08-05 10:54:19
阅读次数:
190
对于数组s[0~n-1],计算next[0~n](多计算一位)。
考虑next[n],假设t=n-next[n],如果n%t==0,则t就是问题的解,否则解为1。
这样考虑:
比如字符串"abababab",
a b a b a b a b *
next -1 0 1 2 3 4 5 6 7
考虑这样的模式匹配,将"ababa...
分类:
其他好文 时间:
2014-08-04 21:38:08
阅读次数:
294