
poj
peter_819
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【树分治】poj1741 tree
题目 Description Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an integer k,for every pair原创 2016-05-27 20:16:51 · 381 阅读 · 0 评论 -
【KMP】【poj3167】【bzoj1729】Cow Patterns
题意 给定一个顺序序列表示奶牛的排列顺序,定义串a=b当且仅当a的每位的排名=b的每位的排名。 题解 预处理出前i位中j出现的次数,由于编号很小,处理出类似前缀和,暴力查询排名即可。已知排名之后就直接kmp。 代码 #include <iostream> #include <cstdio> #include <cstring> #define MAXN 100001 using namespac原创 2017-03-25 21:40:25 · 626 阅读 · 0 评论 -
【kmp】【poj2406】Power Strings
题意 求给定串的最小循环节个数 题解 最小循环节长度=len-border border:最长公共前后缀 kmp 代码 #include <iostream> #include <cstdio> #include <cstring> #define MAXN 1000001 using namespace std; int nxt[MAXN]; char s[MAXN]; int main(原创 2017-03-25 21:47:25 · 245 阅读 · 0 评论