随笔分类 - 字符串处理——后缀数组
摘要:(7题弟弟。C题知道正解,懒得写了) A:^&^ HDU - 6702 题意:给出A,B。求一个最小的C,使得min=(A^C)&(B^C)最小。 思路:如果存在A和B都有的位,那么全选,就行了,这时结果min为0; 否则,选最小的那个,一个有,一个没有的那一位p,结果min=1<<p; #incl
阅读全文
摘要:KMP,扩展KMP和Manacher就不写了,感觉没多大意思。 之前感觉后缀自动机简直可以解决一切,所以不怎么写后缀数组。 马拉车主要是通过对称中心解决问题,有的时候要通过回文串的边界解决问题,这个时候回文树就用到了,又好写,又强大。 之前整理过一篇后缀自动机的。感觉还要整理一下,顺便把回文树,后缀
阅读全文
摘要:FJ is about to take his N (1 ≤ N ≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arranges his cows in a line
阅读全文
摘要:The Little Elephant loves strings very much. He has an array a from n strings, consisting of lowercase English letters. Let's number the elements of t
阅读全文
摘要:However, all efforts to decode their messages have failed so far because, as luck would have it, they have stumbled upon a race of stuttering aliens!
阅读全文
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate
阅读全文
摘要:The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For e
阅读全文
摘要:问题: Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations in the air. Recently they received some strange sig
阅读全文
摘要:Beside other services, ACM helps companies to clearly state their “corporate identity”, which includes company logo but also other signs, like tradema
阅读全文
摘要:后缀家族已知成员 后缀树 后缀数组 后缀自动机 后缀仙人掌 后缀预言 后缀Splay ? 后缀树是后缀数组和后缀自动机的祖先? 功能还是比较强大的,在回文串或者字典序方面还是有用处。 而且现在已经有了线性的建树方法。 (但其实我也没用过后缀树。)下面对比后缀自动机和后缀数组 单个字符串问题 不等号是
阅读全文
摘要:Oimaster and sevenk love each other. 题意: 给定一些模板串,询问每个匹配串在多少个模板串里出现过。 思路: 后缀数组办法: 全部模板串连接在一起SA排序,SA数组附件的串里面去验证原串,还没写,我说不清楚,大概是后缀数组+RMQ处理。 后缀自动机办法: 1,广义
阅读全文
摘要:You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, colour, wrinkles, ears, ey
阅读全文
摘要:Background Before Albanian people could bear with the freedom of speech (this story is fully described in the problem "Freedom of speech"), another fr
阅读全文
摘要:Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate
阅读全文
摘要:问题: The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his mother is getting ill. Being w
阅读全文
摘要:Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one strin
阅读全文
摘要:个人感觉: 之前觉得后缀自动机会了,就忽略了后缀数组,现在发现后缀数组+二分的功能很强,而且后缀自动机好像很难实现。 后缀数组可以结合二分,结合树状数组,甚至结合splay等数据结构来处理rmq,lca等问题。。。所以又从头开始搞后缀数组了。 (找不到原博主网站了,失误) 后缀数组解题总结: 单个字
阅读全文
摘要:Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 seconds Memory limit: 256 megabytes Time limit per test: 1.0 sec
阅读全文
摘要:Problem Description 035 now faced a tough problem,his english teacher gives him a string,which consists with n lower case letter,he must figure out ho
阅读全文
摘要:重复旋律3 重复旋律3 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为长度为 N 的数构成的数列。小Hi在练习过很多曲子以后发现很多作品中的旋律有共同的部分。 旋律是一段连续的数列,如果同一段旋律在作品A
阅读全文