zoj2587 Marlon's String
KMP
求子串的每个前缀在母串中出现的次数,然后反转再求一次,然后计算结果即可
PS:ZOJ评测好严格啊,不强制转换类型会WA。。。就因为这个WA了好久。。。一定不要偷懒啊!!!
#include
#include
#include
#include
#include
#define N 100050
using namespace std;
int jump[N],ans1[N],a
原创
2012-05-12 22:35:06 ·
428 阅读 ·
0 评论