HDU1024 这压缩真先进...先进的我想跳河

HDU1024 题解(DP) HDU1024: 题意:把n个数分出m个区间,使得区间和最大。 思路:DP。状态:dp[i][j]表示把前j个数组分成i组的区间和。 转移方程:dp[i][j] = max(dp[i][j - 1], dp[i - 1][j - 1]) + a[j]; 其中: i - 1 <= k <= j - 1。 ... 阅读详情

Description

Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.

Given a consecutive number sequence S 1, S 2, S 3, S 4 … S x, … S n (1 ≤ x ≤ n ≤ 1,000,000, -32768 ≤ S x ≤ 32767). We define a function sum(i, j) = S i + … + S j (1 ≤ i ≤ j ≤ n).

Now given an integer m (m > 0), your task is to find m pairs of i and j which make sum(i 1, j 1) + sum(i 2, j 2) + sum(i 3, j 3) + … + sum(i m, j m) maximal (i x ≤ i y ≤ j x or i x ≤ j y ≤ j x is not allowed).

But I`m lazy, I don’t want to write a special-judge module, so you don’t have to output m pairs of i and j, just output the maximal summation of sum(i x, j x)(1 ≤ x ≤ m) instead. ^_^

Input

Each test case will begin with two integers m and n, followed by n integers S 1, S 2, S 3 … S n.
Process to the end of file.

Output

Output the maximal summation described above in one line.

Sample Input

1 3 1 2 3
2 6 -1 4 -2 3 -2 3

Sample Output

6
8

这个题大意就是说给你一组数,然后告诉你弄出几个子序列他的和最大….
很好这个题最开始我连状态转移方程都想不到
后来好不容易想到了
dp[a][b】=max(dp[a][b-1】+zhi[b] ,max(dp【a-1】)+zhi【b】 )
这个方程还是比较好理解的,那就是dp代表的涵义就是以b为结尾的子序列和……
这玩意是从1开始循环的因此它的连续性是有保障的
他后边那个东西的意思就是前一层a-1个子序列的最大和….
不管他连不连续只要加上就对了嘛….反正子序列缺一个,正好
但是问题又来了…
这个n是一百万,n方百分之百这个空间复杂度要炸到天上去
然后我就开始懵逼
去看了kuangbin大神的题解…
发现确实有好厉害的方法把这个二维数组压缩到一纬数组….
首先我们可以知道这个层数,顶多用两次,第一次是记录下来,第二次是座位上一层使用
然后我们通过状态转移方程可以看出来要被转移方程的那个和max里的第一个数他的层数是完全一样的,那么就可以省掉
问题在于第二个数
这就是kuangbin大神的独特之处了….
他先使用前一个数代表着上一层的最大,用完了以后更新
这样每一层用完了以后更新的值
是把本层作文下一层的上一层来使用的…
像我这种智商的鶸虽然能想到只开三个数组就够用
但是这个循环不变式我是写不出来的…..
然后当循环到最后一层的时候
把最后一层当做出格的一层的上一层来更新…
所以那个maxx就理所当然的变成了最大值…

还要注意一点…那就是内层循环一定从外层循环的值开始
因为你的数不可能比层数还少…
玛德疯狂WA
更可怕的是
这题用long long 会超时!!!!!!!!
卧槽这不是逗我么

#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int   dp[1000010];
int  da[1000011];
int  zhi[1000011];
#define INF 0x7fffffff
int main()
{
    int  n,m;
    while (cin >> n >> m)
    {
        memset(dp, 0, sizeof(dp));
        memset(da, 0, sizeof(da));
        for (int a = 1;a <= m;a++)scanf("%d", &zhi[a]);
        int  maxx = 0;
        for (int a = 1;a <=n;a++)
        {
            maxx = -INF;
            for (int b = a;b<=m;b++)
            {
                dp[b] = max(dp[b - 1] + zhi[b], da[b-1] + zhi[b]);//用上一层到b前面的最大来转移
                da[b - 1] = maxx;//用完了上一层的,即开始把本层的数据作为下一次迭代的上一层到b前的最大存好
                maxx = max(maxx, dp[b]);//同理,把本层作为下一层的上一层存好,因此在所有的循环都结束后,这就是最大值;
            }
        }
        cout << maxx << endl;
    }
    return 0;
}
运放偏置电路设计:如何精准计算差分放大器的电压偏移量 本文深入解析了差分放大器偏置电路的设计原理与精准计算方法,重点阐述了如何通过引入参考电压实现信号电压偏移,以适应单电源ADC的输入范围。文章结合实战案例,详细推导了偏移电压公式,并强调了电阻匹配、运放选型及PCB布局对精度和共模抑制比的关键影响,帮助硬件工程师避免常见设计陷阱。 阅读详情

相关推荐

Dual-stream multiple instance learning networks for tumor detection in Whole Slide Image——论文笔记

关于多示例学习的资料网上比较少,但是在医学图像方面还是有人在应用的。主要是因为一般比较大,几个G都是十分常见的,这么大图片是无法直接训练,一般都会进行切图,所以天然契合多示例学习bag和instance的概念。最近看了一篇论文刚好关于这方面的,所以做下笔记。 github地址:https://github.com/binli123/dsmil-wsi paper:https://arxiv.org/abs/2011.08939 背景知识 在多示例学习(MIL)中,一组训练样本被视为包含多个instance的

weixin_41693877的博客 4174

Max Sum Plus Plus(dp解题)

Max Sum Plus Plus(hdu-1024) 原题描述: Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given a consecutive number

qq_41678016的博客 1547

DM达梦数据库远程客户端工具连接6001错误,disql可以正常连接

DM达梦数据库远程客户端工具连接6001错误,disql可以正常连接

weixin_45906061的博客 4514

[线性dp][空间优化]Max Sum Plus Plus HDU1024

Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given a consecutive number sequence S1, S2, S3, S4... Sx, ....

Cloth的博客 484

NIDS——suricata(一)

NIDS——suricata环境安装和规则编写

weixin_58666006的博客 1279

通过CN3口直接控制台达伺服电机A2-M(二)

既然可以通过RS485与伺服驱动器进行通讯,那么就肯定可以控制转速 首先,需要了解下 ‘控制模式及控制命令输入源设定’ 依据以上资料,速度控制模式有两种,S和SZ模式,分别对应模式选择中的02和04,对P1-01的地址0102进行写地址操作即可实现,一开始我使用了S模式,但是这个模式在寸动模式下会自动运转,不符合我控制的要求,后面改用SZ模式,就可以实现零速度。 使用串口工具发送命令:“01 06 01 02 00 04 28 35”即可以实现设置,设置完成后可以手动在伺服驱动器的按键面板上进行确

HKing_evil的博客 6831

《HDU 1024 - Max Sum Plus Plus》的题解

《HDU 1024 - Max Sum Plus Plus》的题解 题目的描述 Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are fac...

weixin_46163391的博客 467

Python 高级语法:闭包

闭包(Closure)是函数式编程中的一个重要概念。在Python中,闭包可以简单理解为:一种特殊的函数。外函数:嵌套函数中最外层的函数称之为外函数。内函数:嵌套函数中最内层的函数称之为内函数;内函数引用了外函数的临时变量;外函数的返回使用了临时变量的内函数。

moment159的博客 2357

HDU 1024 Max Sum Plus Plus(最大m子段和)

Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem. Given ...

蒟蒻小胖 477

YOLOv8改进有效系列目录 | 包含卷积、主干、检测头、注意力机制、Neck上百种创新机制

Hello,各位读者们好,本专栏自开设两个月以来已经更新改进教程120+余篇其中包含C2f、主干、检测头、注意力机制、Neck多种结构上创新,也有损失函数和一些细节点上的创新,订阅本专栏以后你不仅可以收获跟专栏的阅读权限,同时可以进Qq群,里面包含集成我所有创新的YOLO最新目录,和我本人录制的视频讲解教程,如果你想要在YOLOv8系列收获一篇论文,我相信订阅本专栏后你一定会有所收获~YOLOv8改进有效系列目录。

Snu77的博客 18万+

基于 YOLOv26 的光伏板热斑检测系统:红外+可见光

本文提出了一种基于YOLOv26的光伏板热斑检测系统,采用红外+可见光双模态融合方案。系统架构包含数据预处理、热斑检测、故障诊断和维修决策等模块,结合无人机巡检与地面监控。关键技术包括YOLOv26目标检测模型、双模态数据融合、边缘计算部署等。研究构建了包含多种故障类型的光伏板专业数据集,并采用数据增强技术提升模型性能。系统实现了热斑检测、分类(轻微/中等/严重/危急)以及功率损失评估等功能,为光伏电站智能运维提供解决方案。

一键难忘的博客 500

dp 题目

Now Ithink you have got an AC in Ignatius. L's "Max Sum" problem. To be abrave ACMer, we always challenge ourselves to more difficult problems. Now youare faced with a more difficult problem. Givena

qq_38630960的博客 263

2024年数字IC秋招-格科微-数字电路设计工程师-笔试题

笔试题型:简答题(9个)笔试平台:牛客(电脑监控)笔试时间:2h。

qq_42135020的博客 1606

Hdu-1024 Max Sum Plus Plus 详解+滚动数组优化

Max Sum Plus Plus Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficu...

ReverieZH的博客 562

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

Max Sum Plus Plus HDU - 1024

Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.  Gi

W-Jarvis把冰雪披戴在肩膀 271

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

hdu1024 Max Sum Plus Plus--DP

原题链接: http://acm.hdu.edu.cn/showproblem.php?pid=1024 一:原题内容 Problem Description Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge

半壶老酒 752

深度学习工具包 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")

动态规划题目一

动态规划练习题一 A - Max Sum Plus Plus Problem Description Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now ...

NaNa 583

HDU1024(最大子段和变式+动态数组)(明天重做)(过一段时间下次看到再重做)

把一个数组分成m段, sum(i1, j1) + sum(i2, j2) + sum(i3, j3) + … + sum(im, jm),求使得上述和最大,ik,jk是连续的jk和ik+1可以不连续 动态规划,d[i][j]表示在选取第j个数字的情况下,将前j个数字分成i组的最大和, 则它的值有两种可能 ①(x1,y1),(x2,y2)…(xi,yi,num[j]) ②(x1,y1),(x2,y2)…(xi-1,yi-1),…,(num[j]),其中yi-1是第k个数字 故:d[i][j]=max(d[.

l1037746466的博客 468

HDU1024(动态规划+滚动数组)

题目大意:把一个数组划分成不相交的m段,使得这m段之和加起来最大。输出最大值。 这道题从题意的分析可知要使用动态规划来做 使用arr[j]来存放第j个数 dp[i][j]的含义:在包含arr[j]的前提下,前i段的最大值,那么我们可以分以下两种情况: 1、arr[j]不是第i段的第一个数,那么此时dp[i][j]就是dp[i][j-1]+arr[j] 2、arr[j]是第i段的第一个个数,那么此...

Joker的博客 379

hdu1024(动态规划+滚动数组优化)

把一个数组分成m段,  sum(i1, j1) + sum(i2, j2) + sum(i3, j3) + ... + sum(im, jm),求使得上述和最大,ik,jk是连续的jk和ik+1可以不连续 动态规划,d[i][j]表示在选取第j个数字的情况下,将前...

弋墨尘的博客 553

HDU1024动态规划(我们不一样)

#include&lt;iostream&gt; #include&lt;algorithm&gt; using namespace std; const int M=1000050; int dp[M]; int dpm[M]; int main() { int m,account,num; while(cin&gt;&gt;m) { cin&gt;&gt...

artistkeepmonkey的博客 418

HDU--1024--段子序列和最大

给定长度为N的序列S。定义sum(i , j) = s[i] + ... + s[j]。给定m,求m段sum(i1, j1) + ... + sum(im,jm)。且没有ix <= iy <=jx。 Input 输入m,输入n。输入n个数。 Output 输出最大和 Sample Input 1 3 1 2 3 2 6 -1 4 -2 3 -2 3 Sample Outpu...

queque_heiya的博客 256

HDU - 1024(DP)

链接:HDU - 1024 题意:给出m,n 和 长度为n的序列,求不相交的m个子区间的最大和 题解:dp[i][j] = max( dp[i][j-1] + a[j], Max( dp[i-1][k] ) + a[j]) {1 #include using namespace std; const int INF = 0x3f3f3f3f; const int maxn =

鬼沐冢 392

hdu1024(基本dp)

/* translation: 给出一串数列,求m个不相交的段最大的和是多少? solution: 基本dp。 设dp[i][j]表示前j个数划分成i段,所得到的最优解。 对于第j个数,有两种决策,一种是单独成立成一个段。另一种是和地i个段组成一段。 所以有转移方程如下:dp[i][j]=max{dp[i][j-1], max{dp[i-1][k]}} + a[i]。其中k>=1 &&

林伏案的博客 500

hdu1024 动态规划

题意是给你个数字序列,现在让你把这个序列分成m个连续的子序列,且要求这m个子序列的累加和最大。 思路:这道题的题意可以理解为问在序列为末尾时,把序列分为m个子序列这个状态时的最大累加和,那么可以得出这个状态应该是由上一个状态转移得来:(因为dp[i][j]表示数到第j个字符时,前j个数字序列被分为i组时的最大值)dp【i][j]=max(dp[i-1][j]+num[j],dp[i][j-1]+...

HPU WIN 757

hdu1024 (滚动数组和动态更新优化)

题意: 给定长度为nnn的序列aaa,从中选取mmm个子段,求子段和的最大值。 题解: f[i][j]f[i][j]f[i][j]表示将前jjj个元素分成iii段可以获得的最大iii段和,其中这里必然包括第jjj个元素。 状态转移为f[i][j]=max(f[i][j−1]+a[j],f[i−1][k]+a[j]),k∈[i−1,j−1]f[i][j]=max(f[i][j-1]+a[j],f[i-1][k]+a[j]),k\in[i-1,j-1]f[i][j]=max(f[i][j−1]+a[j],f[i

solego’s blog 165
上一篇: HDU1950LIS裸题
下一篇: HDU1260简单DP
NineFailure
博客等级 码龄11年 22粉丝 317原创
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值