随笔分类 -  kmp

HDU 1686 Oulipo
摘要:kmp 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int ans; 7 char n[1000010],m[10010]; 8 int next[10010]; 9 10 void getn... 阅读全文
posted @ 2014-07-21 12:12 gfc 阅读(153) 评论(0) 推荐(0)
HDU 1711 Number Sequence
摘要:经典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)... 阅读全文
posted @ 2014-07-19 17:10 gfc 阅读(129) 评论(0) 推荐(0)
HDU 1358 Period
摘要:kmpps:poj 2406Power Strings 是这题的简化版 ←_←太水就不贴代码了。。。#include #include #include using namespace std;const int maxn=1000010;char s[maxn];int next[maxn];in... 阅读全文
posted @ 2014-07-19 17:09 gfc 阅读(155) 评论(0) 推荐(0)