HDU
ooduil
这个作者很懒,什么都没留下…
展开
-
HDU 1686 - Oulipo(kmp)
Problem link分析:kmp匹配 代码:#include <cstdio> #include <cstring>const int maxn = 1000010; char w[maxn], t[maxn]; int _next[maxn];void get_next() { int w_len = strlen(w); int i = 0, j; _next[0]原创 2015-10-21 20:59:01 · 1061 阅读 · 2 评论 -
HDU 2087 - 剪花布条(kmp)
Problem link分析:kmp匹配 代码:#include <iostream> #include <cstring>using namespace std;const int maxn = 1005; char s[maxn], p[maxn]; int _next[maxn];void get_next() { int p_len = strlen(p); int i =原创 2015-10-21 21:18:20 · 1173 阅读 · 0 评论 -
HDU 1711 - Number Sequence(kmp)
Problem link分析:kmp匹配 代码:_next[]数组的名字不能为next[],否则会编译出错 #include <iostream>using namespace std;const int n = 1000010; const int m = 10010;int a[n], b[m]; int _next[m];void get_next(int m) { int i = 0原创 2015-10-21 17:02:01 · 1112 阅读 · 2 评论 -
HDU 3068 - 最长回文(manacher)
Problem link分析:manacher求最长回文字串 代码:使用cin,cout的话需加上ios::sync_with_stdio(false);否则会超时。 #include <iostream>using namespace std;const int maxn = 110010;char s[maxn], t[2 * maxn]; int p[2 * maxn];void manach原创 2015-10-22 20:52:39 · 1390 阅读 · 5 评论