随笔分类 - 后缀自动机
K-th occurrence (后缀自动机上合并权值线段树+树上倍增)
摘要:K-th occurrence (后缀自动机上合并权值线段树+树上倍增) You are given a string SSS consisting of only lowercase english letters and some queries. For each query (l,r,k)(
阅读全文
Longest Common Substring(最长公共子串)
摘要:SP1811 题目描述 A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, al
阅读全文
数字子串的和 str2int
摘要:UVA1673 这道题可以用广义后缀自动机,不过陈锋老师给我们讲了一个巧妙地方法,使得这道题可以用普通的后缀自动机做。 题目大意: 给出NNN个完全由数字组成的字符串。计算将这个NNN的字符串的所有子串转换为整数后先去重再求和的结果,输出其模2012的余数。也就是求其子串的所有本质不同的字符串的和。
阅读全文
Substrings
摘要:SP8222 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 stri
阅读全文
Reincarnation
摘要:HDU4622 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
阅读全文
New Distinct Substrings
摘要:SP705 Given a string, we need to find the total number of its distinct substrings. Input TTT- number of test cases.T<=20T<=20T<=20; Each test case con
阅读全文
Glass Beads
摘要:UVA719 将循环串SSS展开成两倍大小:S+SS+SS+S,这样线性处理就可以处理所有循环的情况了。对S+SS+SS+S建立一个后缀自动机,让后从初始状态开始走,每次选择字典序最小的道路,走NNN步就得到一个字典序最小的原串了。假设最后走到ppp,那么此时首字符下标即为len(p)−N+1len
阅读全文
浙公网安备 33010602011771号