hdu_3294_Girls' research(Manacher)】的更多相关文章

题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=3294 题意:给你一个字符和一个字符串,第一个字符表示该字符代表a,然后让你求变换后的最长回文区间并输出(这里的回文长度要大于1) 题解:直接上马拉车,然后记录一下区间 #include<cstdio> #include<cstring> #define min(a,b) (a)>(b)?(b):(a) #define max(a,b) (a)>(b)?(a):(b) ;//…
Girls' research Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others) Total Submission(s): 1160    Accepted Submission(s): 448 Problem Description One day, sailormoon girls are so delighted that they intend to research a…
Problem Description One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower case) on the paper. For example, "abcd…
One day, sailormoon girls are so delighted that they intend to research about palindromic strings. Operation contains two steps:First step: girls will write a long string (only contains lower case) on the paper. For example, "abcde", but 'a' ins…
题目链接:https://vjudge.net/problem/HDU-3294 Girls' research Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 3209    Accepted Submission(s): 1228 Problem Description One day, sailormoon girls are so…
题目链接: Hdu 3294  Girls' research 题目描述: 给出一串字符串代表暗码,暗码字符是通过明码循环移位得到的,比如给定b,就有b == a,c == b,d == c,.......,a == z. 问最长回文串所在区间,以及最长回文串所表示的明码. 解题思路: 字符串长度[1,200000],用manacher算法很轻松就搞定了. get√新技能请点击me #include <cstdio> #include <string> #include <c…
BUPT2017 wintertraining(15) #5F HDU - 3294 题意 给定字母x,字符串变换一下: 'x'-1 -> 'z', 'x'->'a', 'x'+1->'b', ..., 求对应的字符串的最长的回文串. 题解 求最长回文串的O(n)的算法:Manacher算法 算法过程: 用'#'号把每个字符分隔开,且开头结尾都是'#'. RL[i]为以i为中心的最长回文最右的字符与i的距离. 已经求过的回文串中,右端点最大的回文串的中心为p. 求当前的RL[i]时,若…
Girls' research Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 537    Accepted Submission(s): 199 Problem Description One day, sailormoon girls are so delighted that they intend to research abo…
http://acm.hdu.edu.cn/showproblem.php?pid=3294 Girls' research Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 3294 Description One day, sailormoon girls are so delighted that they intend to res…
变形的求最大回文子串,要求输出两个端点. 我觉得把'b'定义为真正的'a'是件很无聊的事,因为这并不会影响到最大回文子串的长度和位置,只是在输出的时候设置了一些不必要的障碍. 另外要注意一下原字符串s1中的字符在预处理以后的字符串s2中对应的坐标关系,这样输出的时候就可以照着这个关系转化. 轻松1A,嘿嘿 //#define LOCAL #include <iostream> #include <cstdio> #include <cstring> using name…