2020年1月30日
摘要: K-th occurrence (后缀自动机上合并权值线段树+树上倍增) You are given a string SSS consisting of only lowercase english letters and some queries. For each query (l,r,k)( 阅读全文
posted @ 2020-01-30 18:17 SCU_GoodGuy 阅读(182) 评论(0) 推荐(0)
  2020年1月26日
摘要: 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 阅读全文
posted @ 2020-01-26 20:21 SCU_GoodGuy 阅读(284) 评论(0) 推荐(0)
摘要: UVA1673 这道题可以用广义后缀自动机,不过陈锋老师给我们讲了一个巧妙地方法,使得这道题可以用普通的后缀自动机做。 题目大意: 给出NNN个完全由数字组成的字符串。计算将这个NNN的字符串的所有子串转换为整数后先去重再求和的结果,输出其模2012的余数。也就是求其子串的所有本质不同的字符串的和。 阅读全文
posted @ 2020-01-26 17:00 SCU_GoodGuy 阅读(262) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-01-26 15:54 SCU_GoodGuy 阅读(168) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-01-26 15:16 SCU_GoodGuy 阅读(185) 评论(0) 推荐(0)
摘要: 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 阅读全文
posted @ 2020-01-26 15:00 SCU_GoodGuy 阅读(91) 评论(0) 推荐(0)
摘要: UVA719 将循环串SSS展开成两倍大小:S+SS+SS+S,这样线性处理就可以处理所有循环的情况了。对S+SS+SS+S建立一个后缀自动机,让后从初始状态开始走,每次选择字典序最小的道路,走NNN步就得到一个字典序最小的原串了。假设最后走到ppp,那么此时首字符下标即为len(p)−N+1len 阅读全文
posted @ 2020-01-26 14:43 SCU_GoodGuy 阅读(150) 评论(0) 推荐(0)
摘要: https://www.cnblogs.com/zjp-shadow/p/9218214.html#autoid-4-0-0 作者:zjp_shadow 阅读全文
posted @ 2020-01-26 14:29 SCU_GoodGuy 阅读(75) 评论(0) 推荐(0)
  2020年1月24日
摘要: UVA10641 题目为逆时针顺序编号,这里直接将数组开两倍来处理环。(然而不知为啥开到1000也能过) 定义: Corners[i]Corners[i]Corners[i]为体育馆点的坐标。 Lights[i]Lights[i]Lights[i]为灯的坐标及费用。 IsShineOnCur[i]I 阅读全文
posted @ 2020-01-24 02:50 SCU_GoodGuy 阅读(182) 评论(0) 推荐(0)
  2020年1月23日
摘要: UVA1633 一个长的回文串都可以由短的回文串拓展而来,只要短的回文在左右两端增加相同的字符即可。因此,在考虑长度为NNN的01串时,只要在从长度为1向NNN拓展的过程中,保证后KKK个字符不是回文串即可。 定义: dp[i][j]dp[i][j]dp[i][j]为考虑长度为i的串的后KKK个字符 阅读全文
posted @ 2020-01-23 23:08 SCU_GoodGuy 阅读(184) 评论(0) 推荐(0)