随笔分类 - 字符串-后缀数组
摘要:2119: 股市的预测 Description 墨墨的妈妈热爱炒股,她要求墨墨为她编写一个软件,预测某只股票未来的走势。股票折线图是研究股票的必备工具,它通过一张时间与股票的价位的函数图像清晰地展示了股票的走势情况。经过长时间的观测,墨墨发现很多股票都有如下的规律:之前的走势很可能在短时间内重现!如
阅读全文
摘要:【题意】 【分析】 后缀数组水题,嗯,不认真看输出像我一样就会被坑。。 1 #include<cstdio> 2 #include<cstdlib> 3 #include<cstring> 4 #include<iostream> 5 #include<algorithm> 6 #include<q
阅读全文
摘要:The Revenge of the Princess’ Knight Problem Description There is an old country and the king fell in love with a devil. The devil always asks the king
阅读全文
摘要:3473: 字符串 Description 给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串? 给定n个字符串,询问每个字符串有多少子串(不包括空串)是所有n个字符串中至少k个字符串的子串? Input 第一行两个整数n,k。 接下来n行每行一个字符串。
阅读全文
摘要:其实我还没有做完,只做了一点点~~ 2016-07-20 15:44:57
阅读全文
摘要:Musical Theme Description A musical melody is represented as a sequence of N (1<=N<=20000)notes that are integers in the range 1..88, each representin
阅读全文
摘要:Rabbit's String Problem Description Long long ago, there lived a lot of rabbits in the forest. One day, the king of the rabbit kingdom got a mysteriou
阅读全文
摘要:Description The word “the” is the most commonthree-letter word. It evenshows up inside other words, suchas “other” and “mathematics”.Sometimes it hide
阅读全文
摘要:Description If a string is in the form UVU, where U is not empty, and V has exactly L characters, we say UVUis an L-Gap string. For example, abcbabc i
阅读全文
摘要:The Number of Palindromes Problem Description Now, you are given a string S. We want to know how many distinct substring of S which is palindrome. Inp
阅读全文
摘要:Life Forms Description You may have wondered why most extraterrestrial life forms resemble humans, differing by superficial traits such as height, col
阅读全文
摘要:Long Long Message Description The little cat is majoring in physics in the capital of Byterland. A piece of sad news comes to him these days: his moth
阅读全文
摘要:怪盗基德的挑战书 Problem Description “在树最美丽的那天,当时间老人再次把大钟平均分开时,我会降临在灯火之城的金字塔前,带走那最珍贵的笑容。”这是怪盗基德盗取巴黎卢浮宫的《蒙娜丽莎的微笑》这幅画时,挑战书上的内容。 但这次,怪盗基德的挑战书上出现了一串串小写字母“aaab sdf
阅读全文
摘要:Common Substrings Description A substring of a string T is defined as: T(i, k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|. Given two strings A, B and one integer
阅读全文
摘要:题意:给定一个字符串,求重复次数最多的连续重复子串。 传说中的后缀数组神题,蒟蒻真的调了很久才对啊。感觉对后缀数组和RMQ的模版都不是很熟,导致还是会有很多各种各样的小错误= = 首先,枚举重复子串的循环节为L,因为枚举的是循环节长度,所以是没有单调性的,那么枚举就要用0(n)的时间了。连续一次的情
阅读全文
摘要:自己看着大牛的论文学了一下后缀数组,看了好久好久,想了好久好久才懂了一点点皮毛TAT 然后就去刷传说中的后缀数组神题,poj3693是进化版的,需要那个相同情况下字典序最小,搞这个搞了超久的说。 先简单说一下后缀数组。首先有几个重要的数组: ·SA数组(后缀数组):保存所有后缀排序后从小到大的序列。
阅读全文
浙公网安备 33010602011771号