蓝书(算法竞赛进阶指南)刷题记录——POJ1390 Blocks(区间DP+记忆化搜索)

poj(1390)——Blocks 题意: 就是给你总共n个方块,然后让你每次消去一些方块,然后获得的得分是消去方块数的平方。问最后游戏结束的时候得分最大是多少? 思路: 这道题是一道记忆性动归程序,主要是那个dp的状态转移方程有点难想。。。 首先,我们记click_box(i,j,ex_len):表示的是在第j个大块之后有ex_len长度的大块(大块就是相同颜色进行合并之后的块)且j的颜色和ex_len的颜色相同时,在这种 阅读详情

题目:POJ1390.
题目大意:给定一个长度为 n n n的序列,每次可以删除权值相同连续一段且得分为长度的平方,求最大得分.
数据组数 ≤ 15 \leq 15 ≤15, 1 ≤ n ≤ 200 1\leq n\leq 200 1≤n≤200.

按照区间DP的套路,设 f [ l ] [ r ] f[l][r] f[l][r]表示区间 [ l , r ] [l,r] [l,r]的答案,发现根本没办法转移.

考虑无法转移的原因是什么,我们发现在转移的时候,若把中间消掉了,还有一段可以并起来,但是这一段并起来的比原来增加的增量并不能直接算出来,现在我们要解决的是如何提前预知增量.

我们先把连续的同色段并称一个二元组 ( a i , c i ) (a_i,c_i) (ai​,ci​),表示为 a i a_i ai​的颜色连续出现了 c i c_i ci​个.然后我们设 f [ l ] [ r ] [ k ] f[l][r][k] f[l][r][k]表示区间 [ l , r ] [l,r] [l,r]中第 r r r个二元组变成 ( a r , c r + k ) (a_r,c_r+k) (ar​,cr​+k)后的答案,这个问题就变得容易了许多.

考虑如何转移,一种情况是 f [ l ] [ r ] [ k ] f[l][r][k] f[l][r][k]中第 r r r个二元组可以不与前面任意一个合并,即 f [ l ] [ r − 1 ] [ 0 ] + ( c r + k ) 2 f[l][r-1][0]+(c_r+k)^2 f[l][r−1][0]+(cr​+k)2;另一种是当满足 i ∈ [ l , r − 1 ) i\in[l,r-1) i∈[l,r−1)且 a [ i ] = a [ r ] a[i]=a[r] a[i]=a[r]时,第 r r r个二元组与第 k k k个合并,即 f [ l ] [ i ] [ c r + k ] + f [ m i d + 1 ] [ r − 1 ] [ 0 ] f[l][i][c_r+k]+f[mid+1][r-1][0] f[l][i][cr​+k]+f[mid+1][r−1][0].即:
f [ l ] [ r ] [ k ] = { ( c l + k ) 2 l = r max ⁡ { f [ l ] [ r − 1 ] [ 0 ] + ( c r + k ) 2 , max ⁡ i = l , a [ i ] = a [ r ] r − 2 { f [ l ] [ i ] [ c r + k ] + f [ i + 1 ] [ r − 1 ] [ 0 ] } } l = ̸ r f[l][r][k]=\left\{\begin{matrix} (c_l+k)^2&l=r\\ \max \left\{ f[l][r-1][0]+(c_r+k)^2,\max_{i=l,a[i]=a[r]}^{r-2} \left\{ f[l][i][c_r+k]+f[i+1][r-1][0] \right\} \right\}&l=\not{}r \end{matrix}\right. f[l][r][k]={(cl​+k)2max{f[l][r−1][0]+(cr​+k)2,maxi=l,a[i]=a[r]r−2​{f[l][i][cr​+k]+f[i+1][r−1][0]}}​l=rl≠​r​

这个算法的时间复杂度为 O ( n 4 ) O(n^4) O(n4),但其实有大量无用状态不用计算,所以用记忆化搜索实现后常数会变得非常小,实测可以通过本题.

代码如下:

#include<iostream>
#include<cstdio>
#include<algorithm>
  using namespace std;

#define Abigail inline void
typedef long long LL;

const int N=200;

int n,a[N+9],cnt[N+9],dp[N+9][N+9][N+9],vis[N+9][N+9][N+9];

int sqr(int x){return x*x;}

int Dfs_dp(int L,int R,int i){
  int &res=dp[L][R][i];
  if (vis[L][R][i]) return res;
  vis[L][R][i]=1;
  if (L==R) return res=sqr(cnt[L]+i);
  res=Dfs_dp(L,R-1,0)+sqr(cnt[R]+i);
  for (int mid=L;mid<R-1;++mid)
    if (a[mid]==a[R]) res=max(res,Dfs_dp(L,mid,cnt[R]+i)+Dfs_dp(mid+1,R-1,0));
  return res;
}

Abigail into(){
  scanf("%d",&n);
  int ca=0,x;
  for (int i=1;i<=n;++i){
  	scanf("%d",&x);
    if (a[ca]==x) ++cnt[ca];
    else a[++ca]=x,cnt[ca]=1;
  }
  n=ca;
}

Abigail work(){
  for (int i=1;i<=n;++i)
    for (int j=i;j<=n;++j)
      for (int k=0;k<=n;++k)
        vis[i][j][k]=0;
}

Abigail outo(int cas){
  printf("Case %d: %d\n",cas,Dfs_dp(1,n,0));
}

int main(){
  int T;
  scanf("%d",&T);
  for (int i=1;i<=T;++i){
    into();
    work();
    outo(i);
  }
  return 0;
}
POJ1390--blocks.rar 1390--blocks.rar 立即下载

相关推荐

RL调参侠之BipedalWalker BipedalWalkerHardcore SAC

前几天用PPO训练了个很一般的agent: RL调参侠之BipedalWalker PPO 我看SpinningUp上面说PPO和SAC是两个领域里各自的State_of_the_art的方法,所以就打算跑SAC试试看,之前因为Open AI Five的原因,一直感觉PPO很牛掰,实际上现在很多自动驾驶的算法也是用PPO在跑,毕竟有一个“必定能够提升期望”的理论保证在这里,我理解这对做项目很大的诱惑。 不过我跑出来的结果明显是SAC更好。 调参侠时间 策略熵的权重alpha用的0.2,我一开始没有看SAC的

weixin_48370148的博客 2100

POJ_1390(三维动规)

POJ_1390,三维动规题目,按照大块分类,参考博客,重点: 1.构造递归函数 2.通过三维数组记忆化保存 #include<iostream> #include<cstring> #include<cstdio> using namespace std; struct Box{ int color,len; }box[205]; int t,n,x,...

宫·商的博客 460

量化策略开发步骤系列(5)前向测试和统计意义

我们在第 4 部分,展示了我们策略的样本外测试并讨论了其结果。用于开发模型的数据是 2018 年至 2021 年的数据,测试数据是 2021 年至 2022 年的数据。但有一种方法可以更好地利用我们的数据。

码上助君的专栏 1846

第三篇:AMD 和 Intel

它像“乐高积木”一样,可以通过标准化的接口与其他部分组合,构建复杂系统。理解组件后,你会发现从操作系统到微服务,现代软件本质上都是组件的组合!

u013089100的博客 1031

ParallelsDesktop 安装 CentOS-6.9-x86_64-minimal 教程

安装参考 tools没做 想安装的可以参考这个 mac 本机环境: 系统:macOS Catalina version 10.15.6 虚拟机软件:parallels Desktop 15 for Mac( Parallels Desktop-15.1.4(47270)) Centos镜像: CentOS-6.9-x86_64-minimal.iso https://mirrors.aliyun.com/centos-vault/6.8/isos/x86_64/ http://vault.centos.

爱吃鱼的小明的博客 955

POJ 1390:Blocks

将Q与左边的某个大块k合并 score[i][j][len]=score[i][k][len+big[j].len]+score[k+1][j-1][0]一行有n个块,每个框都有一个颜色。将Q消去 score[i][j][len]=score[i][j-1][0]+(big[j].len+len)*(big[j].len+len)因此再考虑利用二维数组score[i][j]来表达状态,即代表第i个大块到第j个大块可以获得的最高分数,则与score[i][j-1]相比,可能。

weixin_74991413的博客 249

STM32 USB AUDIO实战指南——从零构建音频设备

本文详细介绍了如何使用STM32F407构建USB音频设备,从硬件准备到软件配置,再到音频播放和录制功能的实现。通过STM32CubeMX配置和实战代码示例,帮助开发者快速掌握USB Audio Class规范,实现低延迟、高质量的音频传输,适用于语音交互、音乐播放等多种场景。

weixin_42549037的博客 484

poj1390解题报告

题目大意:题意:给定n个不同颜色的盒子,连续的相同颜色的k个盒子可以拿走,权值为k*k,求把所有盒子拿完的最大权值。(有点像祖玛弹珠的即视感) 解题思路:据说是lrj大神黑书上的题,反正我后翻了别人的解题报告才做出来的 首先:合并初始相邻相同的块,得到颜色数组c和对应的长度len,例如 1 1 1 1 1 3 2 2 1 1 1 可记为color[ 1 ] = 1; len[1 ] = 5;

h123120的专栏 1578

RAP 值帮助实战:用 CDS 注解把 Fiori Elements 的输入体验做得又快又准

本文系统介绍了如何在SAP RAP应用中实现高效的值帮助(Value Help)功能。通过复用标准CDS View和自定义View Entity,开发者可以快速为字段添加弹窗选择、搜索和下拉框功能。文章详细讲解了三种核心实现方式:复用标准值帮助CDS View实现快速集成;构建自定义View Entity支持企业特定编码;利用搜索注解(@Search)和下拉框注解(@ObjectModel)优化用户体验。特别强调了文本显示、模糊搜索和小结果集下拉等实用技巧,并提供了可直接复用的国家代码值帮助示例。这些方法能

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 6465

Linux7 挂载 nfs 远程目录

每天一个 DBA 小知识,助你更进一步!

LuciferLiu_DBA 1万+

结题报告poj 1390

参考视频https://www.coursera.org/learn/suanfa-jichu/lecture/lJll3/fang-he-you-xi poj地址http://poj.org/problem?id=1390 #define _CRT_SECURE_NO_WARNINGS #include #include using namespace std; struct Bl

lj102800的专栏 808

手把手教你学Simulink——基于Simulink的模糊自适应PI调节FOC电流环

本文提出基于模糊自适应PI控制的FOC电流环优化方案,针对传统PI控制参数固化、抗扰性差等问题,通过模糊逻辑在线调整PI参数。方案采用双输入(电流误差及变化率)和三输出(ΔKp/ΔKi/PI调节)结构,实现动态响应时间<30μs(提升38%)、超调<5%(降低71%)、参数摄动下误差<±0.4A(精度提升73%)。详细介绍了Simulink建模步骤,包括模糊规则设计(7语言变量、49条规则)、隶属度函数配置及自适应PI实现逻辑,并提供实机部署建议。仿真结果表明,该方法显著提升系统鲁棒性,特

MHD0815的博客 79

【学习】 区间消除类dp

经典的就是poj 1390 Blocks。 这一类的问题总结起来就是可以消除掉一段区间,之后原来的区间的两边会合起来,产生一种新的结果。

yhf_2015 506

老版QQ原生表情gif动态

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

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

POJ 1390 Blocks dp

http://poj.org/problem?id=1390 题意:有一种消方块的游戏,连续且颜色相同的一段称为一段,消掉该段方块所得的分数为该段方块长度的平方,不同的消方块的次序会使得最后的总得分不相同,求一中得分最高的消法。 思路:很经典的一道dp题,出自LRJ黑书123页。首先我们想到的是用dp[i][j] 来表示消掉C[i] .. C[j]总共j-i+1段方块的最优解(最大得分),考虑

Chris_Home 1080

efm32 入门.pdf

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

poj1390 2010.8.1

Blocks Time Limit: 5000MS  Memory Limit: 65536K Total Submissions: 1916  Accepted: 734   Description   Some of you may have played a game called'Blocks'. There are n blocks in a row, each box

Batman_的博客 335

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

poj 1390 Blocks

题目链接:http://poj.org/problem?id=1390 题目大意及思路:见黑书123页,很巧妙的一个dp,定义dp[i][j][k]为从第i到第j段方块且在最后加上k个与第j段方块颜色相同的方块的最大得分。其中k是为了dp而人为加上的东西,从而得到问题的解。 #include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; #include&lt...

java开发指南博客 【转载】 159

POJ1390 Blocks 【动态规划】

Blocks Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 4173   Accepted: 1661 Description Some of you may have played a game called 'Blocks'. There are n bl

长风的专栏 2096

POJ 1390 Blocks(区间DP + 记忆化搜索)

题意: 一排带有颜色的砖块,每一个可以消除相同颜色的砖块,每一次可以到块数 k 的平方分数。问怎么消能使分数最大。 思路: 1. 此题是结合区间动态规划和记忆化搜索的好题,状态转移方程不太好想,以下思路还是根据黑书上面的解释来的; 2. dp[i, j, k] 表示区间 [i, j] 并且在区间后面还有长度为 k 的砖块和 j 的颜色一致; 3. 如果 j 就和后面的 k 个结...

weixin_30462049的博客 182

poj1390

#include&lt;iostream&gt; #include&lt;cstdio&gt; #include&lt;algorithm&gt; using namespace std; int dp[250][250][250]; int v[250], kind[250]; int pre[250], last[250]; int p[250]; int n; int nn; int ma...

guoshiyuan484的博客 311

【POJ 1390】Blocks

http://poj.org/problem?id=1390 黑书上的例题,感觉我这辈子是想不到这样的dp了QAQ \(f(i,j,k)\)表示将\(i\)到\(j\)合并,并且假设未来会有\(k\)个与\(a_j\)同色的方块与\(j\)相连的最大得分。 如果直接消去第\(j\)个区域和未来会接到\(j\)后面的\(k\)块,那么 \(f(i,j,k)=f(i,j-1,0)+(b_j+...

as2886089的博客 182

POJ 1390 Blocks 区间DP

区间DP的核心:把大区间分解成相同规模的小区间,小区间返回子结构的值给大区间从而得到最优解。但是怎么就能根据不同的题模拟出特定的比较合适的子结构呢?我觉得与其说这是一种编码的熟练度问题,不如说是对实际问题建模的敏感度问题。如何设计优秀的子结构问题真的很考验一个人的最基本最核心的创造力和分析能力,刷题套模板真的能整出来吗。。。 就拿这个题来说,可以很轻易的想到dp[i][j]为i到j区间的最优值,...

lizhenhao 244

poj 1390

题意:一个方块消除的游戏,每次可以消除颜色相同的方块,每次得分是你消除的格子的数量的平方。 黑书上的一题。     参照《算法艺术》上的算法       题目的方块可以表示称color[i],len[i],1     这里l表示有多少"段"不同的颜色方块

XYM-AC之路 1967

POJ 1390 Blocks

非常规区间DP(具体用记忆化搜索实现)

curry的博客 383

[poj1390]Blocks(方块消除)

题目大意:给定一序列,可点击某一位置消除与其相邻且相同的方块,得分为$len*len$,求最大得分。 解题关键:关键是状态的构造,首先离散化一下,令$dp[i][j][k]$表示序列$i-j$且后面有$k$个与该序列最后位置相同的元素, 则$dp[i][j][k]$可以由两种情况转化而来, 1、最后一部分自己消除 $dp[i][j][k]=dp[i][j-1][0]+(k+len[j])*(...

weixin_30349597的博客 227
上一篇: 蓝书(算法竞赛进阶指南)刷题记录——POJ1911棋盘分割(二维区间DP)
下一篇: 蓝书(算法竞赛进阶指南)刷题记录——CH5402 & 洛谷2014 选课(树形DP)
hezlik
博客等级 码龄9年 111粉丝 241原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值