
-> 字符串 <-
文章平均质量分 75
Joefery
生命不息,战斗不止。
展开
-
CSU 1598 最长公共前缀 【KMP】
Description给定两个字符串s和t,现有一个扫描器,从s的最左边开始向右扫描,每次扫描到一个t就把这一段删除,输出能发现t的个数。Input第一行包含一个整数T(T每组数据第一行包含一个字符串s,第二行一个字符串t,字符串长度不超过1000000。Output对于每组数据,输出答案。原创 2016-10-08 02:24:31 · 582 阅读 · 0 评论 -
POJ 3461 Oulipo【KMP】
DescriptionThe French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a member of the Oulipo group. A quote from the book:Tout avait Pair n原创 2016-10-08 02:09:35 · 333 阅读 · 0 评论 -
KMP模版 【KMP】
推荐一个学习的地方 点击打开链接#include#include#include#include #include using namespace std;int Next[15000];char s[100],p[100]; //s是字符串,a是模式串int n,m; //n是s的长度,m是p的长度void getNext(int m){ //得到原创 2016-10-08 01:56:33 · 440 阅读 · 0 评论 -
后缀数组的DC3模版【后缀数组】
/* 之前一直用倍增法,发现有些题目卡倍增法,而DC3却能AC,所以顺便弄了 DC3的模版,看以后会不会用到,嗯,就是酱紫 提一些注意点:1.MAXN开n的十倍大小; 2.dc3(r,sa,n+1,Max+1);r为待后缀处理的数组,sa为存储排名位置的数组,n+1和Max+1 都和倍增一样原创 2016-10-12 14:03:29 · 2534 阅读 · 1 评论 -
URAL 1297 Palindrome【后缀数组】求最长回文子串
DescriptionThe “U.S. Robots” HQ has just received a rather alarming anonymous letter. It states that the agent from the competing «Robots Unlimited» has infiltrated into “U.S. Robotics”. «U.S. R原创 2016-10-11 03:22:27 · 893 阅读 · 0 评论 -
SPOJ 694 / SPOJ DISUBSTR Distinct Substrings【后缀数组】不相同的子串的个数
DescriptionGiven a string, we need to find the total number of its distinct substrings.InputT- number of test cases. TEach test case consists of one string, whose length is OutputFor e原创 2016-10-09 20:56:25 · 448 阅读 · 0 评论 -
POJ 3261 Milk Patterns【后缀数组】可重叠的k次最长子串
DescriptionFarmer John has noticed that the quality of milk given by his cows varies from day to day. On further investigation, he discovered that although he can't predict the quality of mi原创 2016-10-09 15:02:12 · 568 阅读 · 0 评论 -
POJ 1743 Musical Theme 【后缀数组】最长不可重叠子串
DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representing a key on the piano. It is unfortunate but true that this re原创 2016-10-08 16:24:51 · 470 阅读 · 0 评论