经典kmp 1 #include 2 #include 3 using namespace std; 4 5 int n,m; 6 int a[1000010],b[10010],next[10010]; 7 8 void getnext (int *s,int *next)...
分类:
其他好文 时间:
2014-07-22 22:52:33
阅读次数:
182
poj3461:http://poj.org/problem?id=3461题意:求一个串在另一个串中出现的次数。题解:直接套用KMP即可,在统计的时候做一下修改。找到之后不是直接返回,而是移动i-(j-next[j])位。 1 #include 2 #include 3 #include 4 #d...
分类:
其他好文 时间:
2014-07-19 18:30:48
阅读次数:
137
Binary String Matching
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述
Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as...
分类:
其他好文 时间:
2014-07-19 13:26:19
阅读次数:
274
poj2406:http://poj.org/problem?id=2406题意:给你一个串,让你找出这个串是由哪个串循环得到,出处循环的次数。题解;知道了KMP,用next数组直接搞定。判断ans=len%(len-next[len])==0?len/(len-next[len]):1; 1 #i...
分类:
其他好文 时间:
2014-07-19 12:21:07
阅读次数:
391
Seek the Name, Seek the Fame
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 11602
Accepted: 5680
Description
The little cat is so famous, that many coup...
分类:
其他好文 时间:
2014-07-19 02:38:26
阅读次数:
204
String Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1512 Accepted Submission(s): 668
Problem Description
Give you a s...
分类:
其他好文 时间:
2014-07-19 02:33:46
阅读次数:
222
Constellations
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 5044
Accepted: 983
Description
The starry sky in the summer night is one of the most beaut...
分类:
其他好文 时间:
2014-07-19 02:17:16
阅读次数:
205
Power Strings
Time Limit: 3000MS
Memory Limit: 65536K
Total Submissions: 31388
Accepted: 13074
Description
Given two strings a and b we define a*b to be their conca...
分类:
其他好文 时间:
2014-07-18 18:15:31
阅读次数:
252
Cyclic Nacklace
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2538 Accepted Submission(s): 1154
Problem Description
CC always ...
分类:
其他好文 时间:
2014-07-18 12:33:57
阅读次数:
312
Theme Section
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1114 Accepted Submission(s): 579
Problem Description
It's time for...
分类:
其他好文 时间:
2014-07-18 12:19:26
阅读次数:
207