KMP
klchen0112
这个作者很懒,什么都没留下…
展开
-
Cyclic Nacklace HDU - 3746
循环节变种。使之成为循环 #include <cstdio> #include <cstring> using namespace std; const int MAX_N = 1000100; #define sci(num) scanf("%d",&num) char str[MAX_N],ps[MAX_N]; int nxt[MA原创 2019-03-13 16:43:07 · 83 阅读 · 0 评论 -
Number Sequence HDU - 1711
数字版kmp#include <bits/stdc++.h>using namespace std;const int MAX_N = 1000100;const int MAX_M = 10010;#define sci(num) scanf("%d",&num)int str[MAX_N],ps[MAX_M];int nxt[MAX_M];int lents...原创 2019-03-11 17:35:13 · 150 阅读 · 0 评论 -
Oulipo POJ - 3461
更改更新后的令j =nxt[j] 不能让j =0 i再回退 会被卡掉#include <cstdio>#include <cstring>using namespace std;const int MAX_N = 1000100;const int MAX_M = 10010;#define sci(num) scanf("%d",&num)cha原创 2019-03-11 17:35:07 · 110 阅读 · 0 评论 -
Period POJ - 1961
可有定义得到到i - nxt[i] 为循环节 且要使之能够整除#include <cstdio> #include <cstring> using namespace std; const int MAX_N = 1000100; const int MAX_M = 10010; #define sci(num) scanf("%d",&num)原创 2019-03-11 17:34:49 · 117 阅读 · 0 评论 -
Power Strings POJ - 2406
循环节的变种 类似POJ 1961#include <cstdio>#include <cstring>using namespace std;const int MAX_N = 1000100;const int MAX_M = 10010;#define sci(num) scanf("%d",&num)char str[MAX_N];int原创 2019-03-11 17:34:22 · 105 阅读 · 0 评论