- 博客(6)
- 资源 (1)
- 收藏
- 关注
原创 POJ 3974 - Palindrome(manacher)
Problem link分析:manacher求最长回文字串代码:#include <iostream>using namespace std;const int maxn = 1000010;char s[maxn], t[2 * maxn];int p[2 * maxn];void manacher(){ int id = 0, mx = 0; for (int i =
2015-10-23 11:53:14 1680 9
原创 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
原创 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
原创 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 1063 2
原创 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 1113 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人