2012年8月31日

poj2752 Seek the Name, Seek the Fame

摘要: http://poj.org/problem?id=2752水题一枚:next函数应用View Code 1 #include<stdio.h> 2 #include<string.h> 3 char str1[500005]; 4 int next[500005]; 5 int a[500005]; 6 void get_next(int x) 7 { 8 int i=0,j=-1; 9 next[0]=-1;10 while(i<x)11 {12 if(j==-1||str1[i]==str1[j])13 {14 ... 阅读全文

posted @ 2012-08-31 16:53 仁者无敌8勇者无惧 阅读(104) 评论(0) 推荐(0) 编辑

hdu 2594Simpsons’ Hidden Talents

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2594View Code 1 #include<stdio.h> 2 #include<string.h> 3 char str1[100010]; 4 char str2[50005]; 5 int next[1000010]; 6 int max(int x,int y) 7 { 8 return x=x>y?x:y; 9 }10 void get_next(int x)11 {12 13 int i=0,j=-1;14 next[0]=-1;15 while(i... 阅读全文

posted @ 2012-08-31 00:05 仁者无敌8勇者无惧 阅读(109) 评论(0) 推荐(0) 编辑

导航