随笔分类 -  ACM-后缀数组&SAM

摘要:It's known to all that ZYB is godlike, so obviously he has a large number of titles, such as jskingjsking, bijingzybbijingzyb and nbazybnbazyb. ZYB li 阅读全文
posted @ 2019-10-09 15:36 StarHai 阅读(585) 评论(0) 推荐(0) 编辑
摘要:What-The-Fatherland is a strange country! All phone numbers there are strings consisting of lowercase English letters. What is double strange that a p 阅读全文
posted @ 2019-09-11 14:36 StarHai 阅读(667) 评论(0) 推荐(0) 编辑
摘要:Typewriter Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 720 Accepted Submission(s): 225 Prob 阅读全文
posted @ 2019-09-06 22:47 StarHai 阅读(396) 评论(0) 推荐(0) 编辑
摘要:Problem Description MZL's Circle Zhou is good at solving some counting problems. One day, he comes up with a counting problem:You are given two string 阅读全文
posted @ 2019-08-26 23:50 StarHai 阅读(307) 评论(0) 推荐(0) 编辑
摘要:链接:https://ac.nowcoder.com/acm/contest/884/I来源:牛客网 题目描述 We call a,ba,ba,b non-equivalent if and only if a≠ba \neq ba​=b and a≠rev(b)a \neq rev(b)a​= 阅读全文
posted @ 2019-07-28 09:36 StarHai 阅读(424) 评论(0) 推荐(0) 编辑
摘要:Farmer 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 ca 阅读全文
posted @ 2019-07-18 22:17 StarHai 阅读(213) 评论(0) 推荐(0) 编辑
摘要:A 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 i 阅读全文
posted @ 2019-07-18 22:05 StarHai 阅读(292) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2019-07-18 10:49 StarHai 阅读(308) 评论(0) 推荐(0) 编辑
摘要:小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一段音乐旋律可以被表示为一段字符构成的字符串。 现在小Hi已经不满足于单单演奏了!他通过向一位造诣很高的前辈请教,通过几周时间学习了创作钢琴曲的基本理论,并开始对曲目做改编或者原创。两个月后,小Hi决定和前辈进行一场创作曲目的较量! 规则是这样的,有两部 阅读全文
posted @ 2019-05-05 22:22 StarHai 阅读(462) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一段音乐旋律可以被表示为一段数构成的数列。 小Hi发现旋律可以循环,每次把一段旋律里面最前面一个音换到最后面就成为了原旋律的“循环相似旋律”,还可以对“循环相似旋律”进行相同的变换能继续得到原串的“循环相似旋律”。 小Hi对此产生了浓厚的兴趣,他有 阅读全文
posted @ 2019-05-03 18:12 StarHai 阅读(306) 评论(0) 推荐(0) 编辑
摘要:题目描述 为了提高智商,ZJY开始学习弦论。这一天,她在《 String theory》中看到了这样一道问题:对于一个给定的长度为n的字符串,求出它的第k小子串是什么。你能帮帮她吗? 输入输出格式 输入格式: 第一行是一个仅由小写英文字母构成的字符串s 第二行为两个整数t和k,t为0则表示不同位置的 阅读全文
posted @ 2019-05-03 14:45 StarHai 阅读(230) 评论(0) 推荐(0) 编辑
摘要:描述 小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。 现在小Hi想知道一部作品中所有长度为K的旋律中出现次数最多的旋律的出现次数。但是K不是固定的,小Hi想知道对于所有的K的答案。 输入 共一行,包含一个由小写字母构成的字符串S。字符串长度不超过 1000000 阅读全文
posted @ 2019-05-03 14:20 StarHai 阅读(432) 评论(2) 推荐(0) 编辑
摘要:小Hi平时的一大兴趣爱好就是演奏钢琴。我们知道一个音乐旋律被表示为一段数构成的数列。 现在小Hi想知道一部作品中出现了多少不同的旋律? 输入 共一行,包含一个由小写字母构成的字符串。字符串长度不超过 1000000。 输出 一行一个整数,表示答案。 题解: 题目意思就是让你求有多少种不同的子串。 后 阅读全文
posted @ 2019-05-03 14:00 StarHai 阅读(224) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2018-12-01 09:29 StarHai 阅读(462) 评论(0) 推荐(0) 编辑
摘要:Farmer 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 ca 阅读全文
posted @ 2018-12-01 09:24 StarHai 阅读(224) 评论(0) 推荐(0) 编辑
摘要:A 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 i 阅读全文
posted @ 2018-11-28 22:44 StarHai 阅读(371) 评论(0) 推荐(0) 编辑
摘要:题解: 题意: 输入n个DNA序列,你的任务是求出一个长度最大的字符串,使得它在超过一半的DNA序列中出现。如果有多解,按照字典序从小到大输入所有解。 把n个DNA序列拼在一起,中间用没有出现过的字符分割。然后求出height数组。 二分满足要求的字符串长度L,然后判断是否可行。 判断可行: 分组方 阅读全文
posted @ 2018-11-28 22:40 StarHai 阅读(384) 评论(0) 推荐(0) 编辑
摘要:后缀数组 字符串:一个字符串S是将n个字符顺次排列形成的数组,n称为S的长度,表示为len(S)。S的第i个字符表示为S[i]。 子串:字符串S的子串S[i…j],i<=j,表示从S串中从i到j这一段,也就是顺次排列S[i],S[i+1],……,S[j]形成的字符串。 后缀:后缀是指从某个位置i开始 阅读全文
posted @ 2018-11-28 21:35 StarHai 阅读(532) 评论(0) 推荐(0) 编辑
摘要:Now you have a string consists of uppercase letters, two integers AA and BB. We call a substring wonderful substring when the times it appears in that 阅读全文
posted @ 2018-09-15 19:22 StarHai 阅读(719) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示