POJ 2752
来源:互联网 发布:淘宝怎么买airbnb卷 编辑:程序博客网 时间:2024/05/18 02:30
/*POJ 2752*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
char str[400002];
int next[400002];
int pre[40];
int len;
while(scanf("%s",str) != EOF)
{
int i, j, count;
len = strlen(str);
i = 0;
j = -1;
next[i] = -1;
for( ; i<len; )
{
if(j == -1 || str[i] == str[j])
{
++i;
++j;
next[i] = j;
}
else
j = next[j];
}
count = 0;
j = len;
while(j != 0)
{
pre[++count] = j;
j = next[j];
}
while(count > 1)
{
printf("%d ",pre[count]);
count --;
}
printf("%d/n",pre[count]);
}
system("pause");
return 0;
}
- POJ 2752
- poj 2752
- poj 2752
- POJ 2752
- poj 2752
- POJ 2752
- poj(2752)
- POJ 2752
- poj 2752
- POJ 2752
- poj 2752
- POJ-2752
- POJ 2752
- POJ-2752
- poj 2752
- Poj 2752
- poj 2752
- POJ 2752
- [SQL server]“从字符串转换为 datetime 时发生语法错误”的解决方法
- (转)学习Linux编程开发必读书籍
- 《Java程序设计》试卷三
- ACM_编程与调试重点记录(十七).doc
- POJ 2406
- POJ 2752
- POJ 3461
- 报到
- shell一些命令的测试(第六章 引用)
- LAMP开发精要(2):Wordpress 插件机制浅析
- 感慨!!!
- C#
- tomcat安装配置
- 如何不用数据库实现内容的动态更新