ACdream1430SETI(后缀自动机)

Posted ---学习ing---

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ACdream1430SETI(后缀自动机)相关的知识,希望对你有一定的参考价值。

 

 问题:

Amateur astronomers Tom and Bob try to find radio broadcasts of extraterrestrial civilizations in the air. Recently they received some strange signal and represented it as a word consisting of small letters of the English alphabet. Now they wish to decode the signal. But they do not know what to start with.
      They think that the extraterrestrial message consists of words, but they cannot identify them. Tom and Bob call a subword of the message a potential word if it has at least two non-overlapping occurrences in the message.

      For example, if the message is “abacabacaba”, “abac” is a potential word, but “acaba” is not because two of its occurrences overlap.
      Given a message m help Tom and Bob to find the number of potential words in it.

Input

      Input file contains one string that consists of small letters of the English alphabet. The length of the message doesn’t exceed 10 000.

Output

      Output one integer number — the number of potential words in a message.

Sample Input

abacabacaba

Sample Output

15

题意:

求字符串里最长的不相交重复字串的长度。

思路;

后缀自动机,记录每个状态的最先出现和最后一次出现的位置,就可以判断是否出现了多次,以及是否相交。

 

以上是关于ACdream1430SETI(后缀自动机)的主要内容,如果未能解决你的问题,请参考以下文章

acdream 1430 SETI 后缀数组+height分组

3.springboot:springboot配置文件(配置文件YAML属性文件值注入<@Value@ConfigurationProperties@PropertySource,@Im(代码片

3springboot:springboot配置文件(配置文件YAML属性文件值注入<@Value@ConfigurationProperties@PropertySource,@Imp(代码片

ACdream1032 Component

ACdream 1101 瑶瑶想要玩滑梯

优化算法学生心理学优化算法(SPBO)含Matlab源码 1430期