HDU 3294 Girls' research】的更多相关文章

题目链接: Hdu 3294  Girls' research 题目描述: 给出一串字符串代表暗码,暗码字符是通过明码循环移位得到的,比如给定b,就有b == a,c == b,d == c,.......,a == z. 问最长回文串所在区间,以及最长回文串所表示的明码. 解题思路: 字符串长度[1,200000],用manacher算法很轻松就搞定了. get√新技能请点击me #include <cstdio> #include <string> #include <c…
Girls' researchTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 4401 Accepted Submission(s): 1642 Problem Description One day, sailormoon girls are so delighted that they intend to research about pa…
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…
题目地址 manacher #include<cstdio> #include<string.h> #include<algorithm> using namespace std; ; char s[Nmax]; +]; +]; +]; int id; int maxlen; int len; int start; int endd; void init() { id=; maxlen=; int n=strlen(s); str[]='$'; str[]='#'; ;…
题意: 给一个字符x代表真实的a 然后输出的时候转换 然后就是求最长回文子串的串是什么 长度要大于1 思路: 就是裸的manacher,弄清楚下标的转换关系就好了 代码: #include"cstdlib" #include"cstdio" #include"cstring" #include"cmath" #include"queue" #include"algorithm" #inc…
#include<stdio.h> #include<string.h> #define MAX 200020 char s[MAX],ss[MAX*2],str[2]; int p[MAX*2]; int chance(char s) { return (s- str[0] + 26) % 26 + 'a'; } int min(int a,int b){return a>b? b:a;} int main() { int i,id,mx,max,n,j,ans,m; wh…
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…
文章目录 思路如下 Manachar代码注释 题解如下 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…
HDU   3294 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 exa…
今天打算补前晚 BC 的第二题,发现要用到能在 O(n) 时间求最大回文子串长度的 Manacher 算法,第一次听,于是便去百度了下,看了大半天,总算能看懂了其思想,至于他给出的代码模板我没能完全看懂,只好自己试着实现,发现理解了思想后还是能实现出来的,用自己的风格去写更好理解,先附上讲解 Manacher 算法的几个链接: Manacher算法--O(n)回文子串算法 (我就是看这个理解的~) Manacher算法处理字符串回文 hdu3068之manacher算法+详解 浅谈manache…