后缀自动机
黑码
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
后缀自动机 重复旋律 6(长度为K的旋律中出现次数最多的旋律的出现次数)
题目1 : 后缀自动机三·重复旋律6 时间限制:15000ms 单点时限:3000ms 内存限制:512MB 描述小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。现在小Hi想知道一部作品中所有长度为K的旋律中出现次数最多的旋律的出现次数。但是K不是固定的,小Hi想知道对于所有的K的答案。解题方法提示输入共一行,包含一个由小写字母构成的字符串S。字符串长度不原创 2017-10-03 14:49:01 · 634 阅读 · 0 评论 -
hdu 4416 后缀自动机 问在S中有多少个不同子串满足它不是s1~sn中任意一个字符串的子串
题意:给一个字符串S和一系列字符串s1~sn,问在S中有多少个不同子串满足它不是s1~sn中任意一个字符串的子串后缀自动机 对sa建立串,然后找每个串在母串上每个点的最大匹配长度,然后最后从后往前拓扑更新就好,因为叶子的max是能影响父亲的max,最后统计的时候 看Maxi是否有值,一旦有值,必定是这个点上的合法的值,那么就是统计上 Max[p]-Maxi[p] 而且往父节点更新,否则就是Max[p原创 2017-10-24 20:45:15 · 552 阅读 · 0 评论 -
后缀自动机求第k大字符串 SPOJ - SUBLEX
Little Daniel loves to play with strings! He always finds different ways to have fun with strings! Knowing that, his friend Kinan decided to test his skills so he gave him a string S and asked him Q qu原创 2017-10-24 19:46:17 · 686 阅读 · 0 评论 -
SPOJ NSUBSTR 求每个对应的长度能产生的相同子串的最大个数
You are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal number of times that some string with length x appears in S. For example for string ‘aba原创 2017-10-24 19:40:05 · 445 阅读 · 0 评论 -
hdu 4436 后缀自动机算和
In this problem, you are given several strings that contain only digits from '0' to '9', inclusive. An example is shown below. 101 123 The set S of strings is consists of the N strings given i原创 2017-10-20 20:00:02 · 459 阅读 · 0 评论 -
spoj 1812(两个串的最长公共子串)后缀自动机
A string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is a consecutive sequence of characters occurre原创 2017-10-05 14:57:00 · 656 阅读 · 0 评论 -
后缀自动机 重复旋律 5(求所有本质不同的子串)
后缀自动机二 重复旋律五本题要求我们求出一个字符串S中本质不同的子串个数。显然,答案就是所有状态上的子串个数之和,这里说的一个状态上的子串个数,是longest-shortest+1。主要需要学习的是,后缀自动机的O(N)构建方法。需要了解的是,一个状态u的shortest=fail.longest+1。#include <bits/stdc++.h>using namespace std;co原创 2017-10-03 13:23:10 · 1477 阅读 · 0 评论 -
后缀自动机 重复旋律 7 求所有不同的子串的值的总和
时间限制:15000ms 单点时限:3000ms 内存限制:512MB 描述小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一段音乐旋律可以被表示为一段数构成的数列。神奇的是小Hi发现了一部名字叫《十进制进行曲大全》的作品集,顾名思义,这部作品集里有许多作品,但是所有的作品有一个共同特征:只用了十个音符,所有的音符都表示成0-9的数字。现在小Hi想知道这部作品中所有不同的旋律的“和”(也就是把串原创 2017-10-03 18:52:30 · 375 阅读 · 0 评论 -
spoj LCS2(多个串的最长公共子序列,后缀自动机)
A string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set of lowercase letters.Substring, also called factor, is a consecutive sequence of characters occurre原创 2017-10-09 17:33:11 · 956 阅读 · 1 评论 -
hdu 4622 后缀数组计数问题||后缀自动机
Now you are back,and have a task to do: Given you a string s consist of lower-case English letters only,denote f(s) as the number of distinct sub-string of s. And you have some query,each time you原创 2017-10-18 10:32:08 · 446 阅读 · 0 评论 -
poj 3415 后缀数组+单调栈||后缀自动机
Common Substrings Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 11519 Accepted: 3814 DescriptionA substring of a string T is defined as:T(i, k)=TiTi+1…Ti+k-1, 1≤i≤i+k-1≤|T|.原创 2017-10-10 15:22:58 · 592 阅读 · 0 评论
分享