Best Reward-(扩展kmp)

从CTF到实战:Frida Hook无导出SO函数的3种特殊姿势 本文深入探讨了在移动安全逆向工程中,如何利用Frida Hook无导出SO函数的三种高级技巧:字符串引用定位法、调用栈回溯法和内存特征码扫描。针对安卓So层加固和混淆场景,文章结合CTF赛题与实战案例,详细解析了每种方法的原理、实现步骤与适用场景,为安全研究人员提供了从理论到实践的完整解决方案。 阅读详情
题目链接:点击进入
题目

在这里插入图片描述
在这里插入图片描述

题意

一个字符串,由26个小写英文字母组成, 每个字母都有各自的价值, 要你将一个字符串切成两个子串, 总价值为两个串价值和, 若是回文, 则串的价值为每个字母价值和, 否则为0,问最大价值多少。

思路

将原串逆序,然后原串与逆序串相互ekmp匹配;对逆串枚举分割点,同时判断逆串分隔的两部分是否回文(根据extend数组判断),价值相加,循环取最大值

代码
#include<iostream>
#include<string>
#include<map>
#include<set>
//#include<unordered_map>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<algorithm>
#include<iomanip>
#include<cmath>
#include<fstream>
#define X first
#define Y second
#define best 131 
#define INF 0x3f3f3f3f3f3f3f3f
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lowbit(x) x & -x
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const double eps=1e-7;
const double pai=acos(-1.0);
const int N=2e4+10;
const int maxn=1e6+10;
const int mod=1e9+7;
int t,n,m,k,cnt,tot;
int Next1[maxn],Next2[maxn],ext1[maxn],ext2[maxn],v[maxn],sum[maxn];
//扩展KMP是用来求主串每个点可以向后延伸与模式串匹配的最长的长度
void getnext(string &s,int Next[])//模式串 
{
    int f=0,l=0,l1=s.size();
    Next[0]=l1;
    for(int i=1;i<l1;i++) 
	{
        Next[i]=min(l-i+1,Next[i-f]);
        if(Next[i]<0) Next[i]=0;
        while(i+Next[i]<l1&&s[Next[i]]==s[i+Next[i]]) 
            Next[i]++;
        if(i+Next[i]-1>l) 
		{
            l=i+Next[i]-1;
            f=i;
        }
    }
}
void exkmp(string &s,string &t,int Next[],int ext[])// t是主串,s是模式串 
{
	int l1=s.size(),l2=t.size();
    getnext(s,Next);
    int f=0,l=-1,minn=min(l1,l2);
    while(l<minn-1&&t[l+1]==s[l+1])
        l++;
    ext[0]=l+1;
    for(int i=1;i<l2;i++)
	{
        ext[i]=min(l-i+1,Next[i-f]);
        if(ext[i]<0) ext[i]=0;
        while(ext[i]<l1&&i+ext[i]<l2&&s[ext[i]]==t[i+ext[i]])
            ext[i]++;
        if(i+ext[i]-1>l)
		{
            l=i+ext[i]-1;
            f=i;
        }
    }
}
int main( )
{
//	ios::sync_with_stdio(false);
//	cin.tie(0);cout.tie(0);
	cin>>t; 
    while(t--)
    {
    	string s1,s2;
        for(int i=1;i<=26;i++)
            cin>>v[i];
        cin>>s1;
        int len=s1.size();
        sum[0]=0;
        for(int i=0;i<len;i++)
        {
            s2+=s1[len-i-1];
            sum[i+1]=sum[i]+v[s2[i]-'a'+1];
        }
        exkmp(s1,s2,Next1,ext1);  //s1是模式串 s2是主串
        exkmp(s2,s1,Next2,ext2);  //s2是模式串 s1是主串
        int ans=0;
        for(int i=1;i<len;i++) 
        {
            int tmp=0,pos=len-i;
            if(i+ext2[i]>=len)//对串2来说,前len-i回文
                tmp+=sum[len-i];
            if(pos+ext1[pos]>=len)//对串2来说,后i个回文
                tmp+=sum[len]-sum[pos];
            if(tmp>ans)
                ans=tmp;
        }
        cout<<ans<<endl;
    }
	return 0;
}
Qt Quick (QML) 老年人健康管理 通过 **Qt SQL** 模块将所有健康数据(用药记录、体检数据等)安全地存储在本地 **SQLite** 数据库中。你想用 **Qt C++** 结合 **Qt Quick** (QML) 来开发一个老年人健康管理软件,主要功能包含 **用药提醒** 和 **健康记录** (使用 `Qt SQL` 存储数据)。* **UI 框架**: Qt Quick (QML) - 用于构建流畅、动态的用户界面。**数据模型类 (models/MedicationReminder.h / .cpp)** 阅读详情

相关推荐

国家大地2000坐标系投影坐标转高德地图经纬度坐标-【高斯投影坐标】

国家大地2000坐标系投影坐标转换成高德经纬度坐标显示画图。

devil_zhuzhu的博客 1万+

【HDU 3613】Best Reward

【题目链接】           点击打开链接【算法】          正反两遍EXKMP,即可【代码】         #include&lt;bits/stdc++.h&gt; using namespace std; #define MAXC 26 #define MAXL 500010 int T,ans,tmp,i,len; int a[MAXC+1],Next[MAXL],exte...

even_bao的博客 381

手把手教你用gmid方法设计二级运放:从理论到仿真全流程(附避坑指南)

本文详细介绍了使用gmid方法设计二级运放的全流程,从理论到仿真实践,特别针对初学者常见问题提供避坑指南。通过系统化的晶体管尺寸确定技术,帮助工程师在性能、功耗和面积之间找到最佳平衡点,适用于模拟集成电路设计中的关键模块开发。

weixin_29213525的博客 271

Best Reward (Manacher算法)

Best Reward After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit. One of these treasures is a nec

codeswarrior的博客 467

VScode - 从入门到精通:高效开发环境搭建指南

本文是一份全面的VSCode高效开发环境搭建指南。从选择理由、安装配置、核心插件推荐到个性化设置与高效技巧,详细讲解了如何将这款轻量级编辑器武装成强大的开发工具。重点介绍了GitLens、Prettier、Live Server等必备插件,以及通过用户设置、代码片段和快捷键打造专属高效工作流的方法,帮助开发者从入门到精通。

weixin_27734811的博客 426

EtherCAT应用层协议选型指南:CoE、SoE、EoE、FoE、AoE到底怎么选?看完这篇就懂了

本文深入解析EtherCAT应用层协议(CoE、SoE、EoE、FoE、AoE)的选型策略,从实时性、数据吞吐量和功能完整性三大核心指标出发,提供工业场景下的实战决策框架。通过技术特性对比、混合协议架构设计和常见故障规避指南,帮助工程师优化自动化设备通信性能。

weixin_28718793的博客 490

hdu3613(扩展KMP)

用kmp的方法写了好久,发现以我的想法用kmp不仅难以实现而且无法证明正确性。 于是还是使用扩展kmp。。。 Best Reward Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 378    Accepted Submission(...

weixin_34087301的博客 157

手把手教你用芯驰X9HP驱动MAX96755/MAX96752点亮智能座舱仪表屏(附完整寄存器配置表)

本文详细介绍了如何使用芯驰X9HP驱动MAX96755/MAX96752实现智能座舱仪表屏的完整开发流程,包括硬件架构解析、关键寄存器配置、Linux BSP集成及调试技巧。通过实战指南和完整寄存器配置表,帮助开发者快速掌握驱动开发核心技术,提升智能座舱系统的显示性能与稳定性。

weixin_30879169的博客 526

HDU3613:Best Reward(拓展KMP)

Problem Description After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit.  One of these treasures is a

ACM!荣耀之路! 2142

FPGA时钟架构解密:从SRCC/MRCC到全局时钟树的实战指南

本文深入解析Xilinx 7系列FPGA时钟架构,从SRCC/MRCC引脚特性到全局时钟树设计,详细介绍了BUFG、BUFMR等关键组件的应用场景和优化策略。通过对比SRCC与MRCC的驱动范围及适用场景,提供低抖动时钟布线技巧和时钟域交叉(CDC)设计方法,帮助工程师构建高性能FPGA时钟系统。

weixin_29191081的博客 1483

MATLAB仿真实战:双有源桥(DAB)变换器的扩展移相调制(EPS)全流程解析

本文提供了一份详细的MATLAB/Simulink仿真实战指南,手把手解析双有源桥(DAB)变换器在扩展移相调制(EPS)下的全流程建模。内容涵盖从核心原理、主功率电路搭建、EPS驱动信号生成,到仿真运行、波形分析及模型优化的完整步骤,旨在帮助工程师和研究者快速掌握DAB变换器的仿真与性能验证方法。

o4p5q6r7s的博客 503

Best Reward

https://vjudge.net/contest/238741#problem/S 题目的要求就是给你一个字符串让你把它分成两个字符串 第一行给你26个字母的价值,如果分出来的子串是回文序列,那么它的价值就是序列所有字母价值的和,如果不是回文序列则价值为0 扩展kmp:将母串s1分为T1,T2两个子串(T1为前半串,T2为后半串) 首先找到s1的倒串s2;用s1去匹配s2,判断T1是不...

Mr___jie的博客 491

零基础实战:YOLO检测头自定义替换全攻略

本文为零基础用户提供了YOLO检测头自定义替换的完整实战指南。通过将检测头比作汽车的“方向盘”,文章详细阐述了为何需要替换、如何寻找和集成新检测头模块、修改配置文件以及最终训练验证的全过程,旨在帮助用户针对特定任务(如小目标检测)提升模型性能。

perl8的博客 255

扩展kmp的应用 Best Reward

Best Reward 题意:给定一个长度为n的字符串,问你能否将这个字符串分成两个字符串,如果分成的字符串是回文子串,那么就会有价值,求分成两个串的最大价值。 题解:学习到一手扩展kmp预处理后,o(1)就能判断分成的两个串是否为回文子串。s1为原串,s2为s1翻转之后的串,然后你对s2求s1的ex数组,对s1求s2的ex数组。然后再根据ex数组的定义,手推一下如何判断分成的两个串是否是回文串,具体可以看代码。 #include <iostream> #include <string.h

qq_44335608的博客 209

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

S - Best Reward 扩展KMP

After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit.One of these treasures is a necklace made up of ...

aocan6909的博客 111

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

扩展KMP --- HDU 3613 Best Reward

Best Reward Problem's Link:   http://acm.hdu.edu.cn/showproblem.php?pid=3613   Mean:  给你一个字符串,每个字符都有一个权值(可能为负),你需要将这个字符串分成两个子串,使得这两个子串的价值之和最大。一个子串价值的计算方法:如果这个子串是回文串,那么价值就是这个子串所有字符权值之和;否则价值为0。  

北岛知寒 285

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

HDU 3613 Best Reward(扩展KMP)

题意:每个字母有一个权值,要把一个字符串分为2部分(都非空),只有这部分是回文串才能算权值,问权值和最大是多少。 做法:这题比较简单,用manacher算出每个点为中心的最大回文串长度,必须延伸到两端才是有用的。不过学习了下扩展KMP。 学习资料:http://www.cnblogs.com/Rlemon/archive/2013/06/26/3157574.html 思想其实跟manach

glq007的acm的奋斗 871

[扩展KMP][HDU3613][Best Reward]

题意:将一段字符串 分割成两个串 如果分割后的串为回文串,则该串的价值为所有字符的权值之和(字符的权值可能为负数),否则为0。 问如何分割,使得两个串权值之和最大思路:首先了解扩展kmp 扩展KMP:给出模板串A和子串B,长度分别为lenA和lenB,要求在线性时间内,对于每个A[i](0<=i<=lenA-1),求出A[i..lenA-1]与B的最长公共前缀长度,记为ex[i](或者说

学习之路 476

HDU3613 Best Reward(扩展KMP)

题意:给一个由小写字母构成的字符串,每个字母否有对应的值,将串分成两个子串,如果子串是回文串的话子串的值就是每个字符的值之和;否则子串的值就是0.原串的值等于两个子串之和,求原串能取到的最大的值。 思路:求回文子串的和的最大值显然需要找出所有可能的回文子串,可以用扩展KMP。先将原串s1反转得到s2,以s1为目标串s2为模式串做一次扩展KMP得到extend1数组,此时若 extend1

hcx11333的博客 287

HDU 3613 Best Reward 正反两次扩展KMP

题目来源:HDU 3613 Best Reward 题意:每个字母对应一个权值 将给你的字符串分成两部分 如果一部分是回文 这部分的值就是每个字母的权值之和 求一种分法使得2部分的和最大 思路:考虑扩展KMP 输出a串 得到a的反串b 求出f[0]和f[1] 和 extend[0]和extend[1] 正反求2次 枚举位置i 分成2部分0到i-1 和i到n-1 因为分成的2部分必须组成原字符

嗯。 1045

HDU Best Reward (扩展KMP)

Best Reward Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/65536K (Java/Other) Total Submission(s) : 23   Accepted Submission(s) : 8 Problem Description After an uphill battle, Gener...

weixin_33971977的博客 114

扩展kmp求最长回文子串_hdu3613 Best Reward 扩展kmp or O(n)求最大回文子串

/**题目:hdu3613 Best Reward链接:http://acm.hdu.edu.cn/showproblem.php?pid=3613题意:有一个字符串,把他切成两部分。如果这部分是回文串,那么他的值为所有字母的权值和。否则这部分值为0;这两部分的值和为该切法的权值。求最大的切法的权值。思路:如果能够判断[0,i],[i,n-1]是一个回文串(0<=i取最大的。扩展kmp的做法...

weixin_39762001的博客 158

HDU3613 Best Reward —— 扩展KMP

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3613 Best Reward Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2644    Accepted Sub

A man can be destroyed, but not defeated. 375

HDU 3613 Best Reward(扩展KMP模板)

After an uphill battle, General Li won a great victory. Now the head of state decide to reward him with honor and treasures for his great exploit. One of these treasures is a necklace made up of 26 different kinds of gemstones, and the length of the neck

HJY 324

hdu 3613 Best Reward 扩展kmp

#include<iostream> #include<cstring> #include<cstdio> using namespace std; const int MM=500100; int next1[MM],extand1[MM]; int next2[MM],extand2[MM]; int sum[MM]; char S[...

amily05200的博客 147

hdu 3613 Best Reward (kmp扩展)

题意: 给出一个字符串,并且给出每种字符串对应的价值,现在要二分这个字符串,如果二分的两部分,如果是回文串就加上对应字符的价值所谓这两个部分的价值,如果不是回文两个部分的价值为0。 题解: 这题相当于可以转化为求回文前缀和后缀,求回文前缀:将原串反转接到原串后面。求回文后缀:将原串接到原串反转后的串后面。人后求next数组,next[len]就最长的那个回文前缀,不断k=next[k]就能找

ACM之梦 554
上一篇: Palindrome-(Manacher算法)
下一篇: 2021牛客寒假算法基础集训营4-B-武辰延的字符串( 扩展kmp / 二分+哈希)
Cosmic_Tree
博客等级 码龄7年 134粉丝 337原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值