随笔分类 -  字符串--Manacher

摘要:1258 - Making Huge Palindromes PDF (English) Statistics ForumTime Limit: 1 second(s) Memory Limit: 32 MBA string is said to be a palindrome if it rema 阅读全文
posted @ 2019-08-03 15:15 _Ackerman 阅读(257) 评论(0) 推荐(0)
摘要:K: 题意:求回文串。 思路:Manacher算法模版题 1 #include <stdio.h> 2 #include <algorithm> 3 #include <iostream> 4 #include <stdbool.h> 5 #include <stdlib.h> 6 #include 阅读全文
posted @ 2019-08-02 00:06 _Ackerman 阅读(214) 评论(0) 推荐(0)
摘要:Manacher's 马拉车算法其实就是用来解决最长回文字符串的问题的。 回文串就是正反读起来就是一样的,如“abba”。 如果暴力去解决这个问题的话,它的时间复杂度是O(n^3) 当然我们还可以优化一下采用中心检测法,这样可以使算法的复杂度降为O(n^2) + O(1) 现在重点来了,马拉车算法可 阅读全文
posted @ 2019-07-31 19:45 _Ackerman 阅读(258) 评论(0) 推荐(0)