POJ 4047: Garden

MyEclipse 2017 CI 10安装与激活 本文介绍MyEclipse 2017 CI 7、CI 8、CI 9和CI 10的安装与激活。此方法理论上应该能激活MyEclipse 2017 CI所有系列,即激活方法是通用的,只是激活文件略有不同。本文提供MyEclipse 2017 CI 7、CI 8、CI 9和CI 10的激活文件。说明:博主所提供的压缩包格式均为RAR5,即WinRAR 5.0以上的版本才能正常解压,别的压缩软件博主不太清... 阅读详情

线段树模板题

哎,好久没写线段树了,吃力。


题目链接:http://poj.org/ProblemDescriptions/jinghua.pdf


题意:

对某个区间进行以下三种操作:

0、改变某个位置的值

1、交换某两个位置的值

2、查询某个区间内连续k个数和最大值


算法:

由于k的值是确定的,

所以直接用每个叶子节点保存它之前的k个元素的值即可。


#include<cstdio>
#include<iostream>
#include<sstream>
#include<cstdlib>
#include<cstring>
#include<string>
#include<climits>
#include<cmath>
#include<algorithm>
#include<queue>
#include<vector>
#include<stack>
#include<set>
#include<map>
#define INF 0x3f3f3f3f
#define eps 1e-8
using namespace std;

const int MAXN=210000;
int a[MAXN],sum[MAXN];
int tr[MAXN<<2],ret[MAXN<<2];

void pushup(int rt) {
    tr[rt]=max(tr[rt<<1],tr[rt<<1|1]);
}

void pushdown(int rt) {
    if(ret[rt]) {
        tr[rt<<1]+=ret[rt];
        tr[rt<<1|1]+=ret[rt];
        ret[rt<<1]+=ret[rt];
        ret[rt<<1|1]+=ret[rt];
        ret[rt]=0;
    }
}

void build(int l, int r, int rt) {
    ret[rt]=0;
    if(l==r) {
        tr[rt]=sum[l];
        return;
    }
    int mid=(l+r)>>1;
    build(l,mid,rt<<1);
    build(mid+1,r,rt<<1|1);
    pushup(rt);
}

void update(int l, int r, int L, int R, int c, int rt) {
    if(L<=l&&r<=R) {
        tr[rt]+=c;
        ret[rt]+=c;
        return;
    }
    pushdown(rt);
    int mid=(l+r)>>1;
    if(L<=mid) {
        update(l,mid,L,R,c,rt<<1);
    }
    if(R>mid) {
        update(mid+1,r,L,R,c,rt<<1|1);
    }
    pushup(rt);
}

int query(int l, int r, int L, int R, int rt) {
    if(L<=l&&r<=R) {
        return tr[rt];
    }
    pushdown(rt);
    int mid=(l+r)>>1;
    int tmp=INT_MIN;
    if(L<=mid) {
        tmp=max(tmp,query(l,mid,L,R,rt<<1));
    }
    if(R>mid) {
        tmp=max(tmp,query(mid+1,r,L,R,rt<<1|1));
    }
    return tmp;
}

int main() {
    int cas;
    scanf("%d",&cas);
    while(cas--) {
        int n,m,k;
        scanf("%d%d%d",&n,&m,&k);
        for(int i=0; i<n; i++) {
            scanf("%d",&a[i]);
            sum[i]=a[i];
            if(i) {
                sum[i]+=sum[i-1];
            }
            if(i>=k) {
                sum[i]-=a[i-k];
            }
        }
        build(0,n-1,1);
        while(m--) {
            int p,x,y;
            scanf("%d%d%d",&p,&x,&y);
            if(p==0) {
                x--;
                update(0,n-1,x,x+k-1,y-a[x],1);
                a[x]=y;
            } else if(p==1) {
                x--;
                y--;
                int tmp=a[x];
                update(0,n-1,x,x+k-1,a[y]-a[x],1);
                a[x]=a[y];
                update(0,n-1,y,y+k-1,tmp-a[y],1);
                a[y]=tmp;
            } else {
                x--;
                y--;
                printf("%d\n",query(0,n-1,x+k-1,y,1));
            }
        }
    }
    return 0;
}


WSL子系统启动报错 Wsl/Service/CreateInstance/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE WSL子系统启动报错 :Wsl/Service/CreateInstance/CreateVm/HCS_E_SERVICE_NOT_AVAILABLE 于是分析原因,最终发现是Windows功能中的虚拟机平台功能不知道什么时候被取消了。 阅读详情

相关推荐

波克 上海 Unity开发笔试题 2024

主要分为四部分,如果没有准备好,不要点击笔试链接,进入就会自动开始。

z2014z的博客 3397

POJ 4047 Garden

POJ 4047 Garden 线段树题目,很简单。需要预处理一下,树的节点中存储的元素为区间的两个端点,然后该段中最大的值,还有延迟标记。预处理的时候先求出所有长度为k的序列的长度,然后建树。具体的程序如下:开始的时候忽略了测试例子数,所以一直runtime error。 /* ID : csuchenan PEOG: D Garden LANG: C++ */ #include #inc

BootStar 426

Linux【实战】—— LAMP环境搭建 & 部署网站

由LinuxApacheMySQLPHP组成的一个web网络平台。

2201_75935630的博客 4980

POJ 4047 Garden 解题报告

题目 题意: 有n个连续的一维上的点,每个点有一个美丽值。 每次有三种操作: 1、将x点的美丽值改为y。 2、将x、y交换 3、查询[x y]间,连续k个点的美丽值总和的最大值。 解法: 线段树,叶子i表示[i i+k]美丽值总和,然后每个点维护一个区间最大值。 修改时区间修改,将包含x的所有叶子都修改(用lazy标记),查询时输出区间最大值。 Time:3

Tri_integral的专栏 938

nbiot和2g_浅谈NBIOT

一、什么是NBIOT?1、概念窄带物联网(Narrow Band Internet of Things, NB-IoT),NB-IoT构建于蜂窝网络,只消耗大约180KHz的带宽,使用License频段,可采取带内、保护带或独立载波等三种部署方式,与现有网络共存。可直接部署于GSM网络、UMTS网络或LTE网络,以降低部署成本、实现平滑升级。2、NBIOT的特点和目标(1)超强覆盖:相对GPRS来...

weixin_39534100的博客 1704

Abaqus边界条件设置避坑指南:为什么你的实体单元转动自由度总是不生效?

本文深入解析了Abaqus中实体单元转动自由度设置失效的根本原因。从力学原理与有限元节点自由度的本质区别出发,阐明了实体单元仅具有平动自由度,直接约束其转动自由度是无效操作。文章提供了对称边界条件的正确设置方法,并给出了使用耦合约束等高级方案来模拟真实抗转动约束的实战指南,帮助用户避免常见建模陷阱。

weixin_29290379的博客 621

poj 4047 Garden(线段树)

http://poj.org/problem?id=4047 求给定区间连续k个值和的最大值,有单点更改和交换操作。 这题主要是建树,以每个节点开始的连续k个值的和作为一个节点,这样共有n-k+1个节点,更新时计算出更新的点所在节点的范围,更新值为 新值-旧值。 交换即为两次更新,线段树记录节点最大值。code:#include<cstdlib>#include<cctype...

weixin_33671935的博客 116

【CAD】【手把手带你写一个DXF&JAVA解析框架】02——整理DXF元数据实体类,涵盖重要属性与对照组码

本文系统梳理了DXF文件解析中的核心元数据类,重点分析了Tables段(图层、块记录)、Blocks段和Entities段的关键数据结构。通过详细的组码说明和对照代码实现,阐述了图层定义(DXFLayer)、块记录(DXFBlockRecord)、应用程序标识(DXFAppId)等表对象的属性构成;同时解析了直线(DXFLine)、多段线(DXFLwPolyLine)、圆弧(DXFArc)、文字(DXFText)等实体类的几何特征与属性定义。文章还构建了顶点(Vertex)、基类(DXFEntity、DXF

Wonder ZH 269

poj 4047 Garden

金华邀请赛的题,可惜现场赛我sb了,没想出来,还是队友想的……还是要不断的练习呀,隔断时间不练习就不会了 #include #include #include using namespace std; #define lson l,m,rt #define rson m+1,r,rt const int maxn=222222; int d[4*maxn],n,k

态度决定高度 873

Bootstrap方法详解——技术与实例

一、Introduction 如果说到Bootstrap你会想到什么?是Twitter推出的那个用于前端开发的开源工具包吗?Unfortunately,本文要讨论的并非是Bootstrap工具包,而是统计学习中一种重采样(Resampling)技术。这种看似简单的方法,对后来的很多技术都产生了深远的影响。机器学习中的Bagging,AdaBoost等方法其实都蕴含了Bootstrap的思想...

白马负金羁 8万+

使用 WSL 在 Windows 上安装 Linux

开发人员可以在 Windows 计算机上同时访问 Windows 和 Linux 的强大功能。通过适用于 Linux 的 Windows 子系统 (WSL),开发人员可以安装 Linux 发行版(例如 Ubuntu、OpenSUSE、Kali、Debian、Arch Linux 等),并直接在 Windows 上使用 Linux 应用程序、实用程序和 Bash 命令行工具,不用进行任何修改,也无需承担传统虚拟机或双启动设置的费用。

隔壁老瓦的专栏 2872

【POJ】4047 Garden

1 #include<cstdio> 2 #define MAXN 200010 3 #define INF 987654321 4 int a[MAXN],s[MAXN],tree[MAXN<<2],lazy[MAXN<<2],k; 5 inline int MAX(int x,int y) 6 { 7 re...

weixin_30726161的博客 90

Claude Code 分布式并行开发最佳实践:1中枢+10Worker跨多Git仓库全流程落地

本文介绍了一套基于Claude Code和Git Worktree的分布式并行开发方案,解决多仓库、微服务开发中的核心痛点。方案采用"1个决策中枢+10个并行Worker"架构,中枢负责任务拆解和调度,每个Worker绑定独立仓库实现完全隔离开发。关键优势包括:任务并行效率提升10倍、跨仓库依赖自动编排、版本统一管理、零第三方依赖。文章详细提供了环境准备、架构设计、中枢搭建和初始化脚本等全流程落地指南,特别适合多仓库协同的全栈开发场景。

AI天才研究院 244

POJ 4047 Garden 线段树

这题只要想出怎么建树就简单了吧。 他问的是连续k个值最大的是多少 就可以用1~k之和,2~k+1之和,3~k+2之和.......做为结点。 然后就发现,变成了简单的区间更新和区间查询问题了。 #include #include #include #include #include #include #include #include #include #define e

水 1296

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

深度学习工具包 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 4047 Garden (线段树)

题意:输入N,M,K。有N个点,每个点有一个值,然后有M个操作 0 x y 表示将x的值赋为y;  1 x y 表示将x和y互换下位置(相应值也互换) ; 2 x y 表示询问[x,y]内连续K个数和的最大值。 一开始想用每个点来建树,发现不好维护区间内连续K个数的和的最大值。 但如果转化一下,因为K是定值,将[x,x+k-1]区间的和看做一个点,这样以连续K个数和作为点,共有N-K+

Paradiser 1029

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

POJ 4047Garden

金华邀请赛题目D 线段树 #include <iostream>#include <cstdio>#include <cstring>using namespace std;struct node{ int l,r; int mx; int re;};node lt[800000];int n,Max;int a[200003],b[2000...

weixin_30443747的博客 100

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

poj 4047 Garden 线段树lazy标记与成段更新

线段树lazy标记技术副题详解

sepNINE的专栏 783

POJ - 4047 Garden(线段树成段更新,查询最值)

题意:含n个元素的序列 ,有q个操作。 操作( p x y)有三种: 0 x y :把第x个的值改为y 1 x y:交换第x个和第y个的值 2 x y:问区间[x,y]里面连续k个的子序列的最大和 思路:先处理序列,SumK[i]表示从i开始的k个数的和,然后线段树建树,成段更新,查询。更新只要处理成对区间最值得加减就可以了。 成段更新还是不熟悉,于是顺便做了 POJ - 3468 A Simple Problem with Integers,也是成段更新,查询为区间元素和,有些不同。

luciozhang的博客 787

POJ【4047】——Problem D. Garden 线段树

DescriptionThere are n flowerpots in Daniel’s garden. These flowerpots are place positions, and these n positions are numbered from 1 to n. Each flower is assigned an aesthetic value. The aesthetic val

绝尘 618

2012金华邀请赛D题(POJ4047 Garden)解题报告

金华邀请赛D题,现场lazy标记推错了,颇为不爽,重做一下。 给出一个N个数的序列以及一个k(0<k<=n<=200000),m个操作p,x,y,其中 p=0:将x位置的数替换为y p=1:将x y位置的数互换 p=2: 查询x-y位置区间连续k个数的和的最大值 很快可以想到用O(n)的复杂度预处理,将从i位置起始连续k个数的和求出来,那么对于查询操作,就变...

259

poj 4047 Garden 2012金华邀请赛 线段树

/* 三种操作 0 x y 把x位置的值改成y 1 x y 交换x与y位置的值 2 x y 统计[x,y]中连续k个值的最大值 我们把1-k的和值作为b[1],2-(k+1)的和值作为b[2],以此类推 那么可以建立一棵[1,n-k+1]的线段树 求连续k个和的最大值,退化为求某个区间的最值问题 线段树中有延迟操作,优化时间效率 */ #include #include #include #

Join Hands 3504

POJ 4047 Garden(线段树)

这个题目,emmm,PDF格式,我复制出来实在是没啥格式可言,这里就不挂题目了。 参考题解 有n个连续的一维上的点,每个点有一个美丽值。 每次有三种操作: 1、将x点的美丽值改为y。 2、将x、y交换 3、查询[x y]间,连续k个点的美丽值总和的最大值。 这里我是看的题解的做法,利用线段树,叶子i表示[i i+k]美丽值总和,然后每个点维护一个区间最大值。每个位置向前取k个数,作为这个位置的结果...

Steve·Curcy 195

poj_4047Garden区间更新_求和

/* 题意: 给出一个N个数的序列以及一个k(0<k<=n<=200000),m个操作p,x,y,其中 p=0:将x位置的数替换为y p=1:将x y位置的数互换 p=2: 查询x-y位置区间连续k个数的和的最大值 解析:求连续区间和最大,可以讲每个区间(我们取左端点)当做一个点,点的附加信息(线段树结子叶点的值) 就等于该区间的连续k个数最大值,可以分为1~k,2~k+1...n-

西北有高楼的专栏 544

POJ 4047 Garden 线段树 区间更新

给出一个n个元素的序列,序列有正数也有负数 支持3个操作: p x y 0.p=0时,把第x个的值改为y 1.p=1时,交换第x个和第y个的值 2.p=2时,问区间[x,y]里面连续k个的子序列的最大和(保证y-x+1>=k) 我们只要定义数组v v[i]表示原序列中,从第i个开始,连续k个元素的值的和 然后我们只需要维护一棵线段树,树的叶子节点表示数组v 树的节点维...

weixin_30412577的博客 111

POJ - 4047 Garden 线段树 区间更新

题目链接:点击查看 题意: 给出一个N个数的序列以及一个k(0&lt;k&lt;=n&lt;=200000),m个操作p,x,y,其中 p=0:将x位置的数替换为y p=1:将x y位置的数互换 p=2:  查询x-y位置区间连续k个数的和的最大值 题解:每个位置向前取k个数,作为这个位置的结果,线段树维护下每个区间的最大值即可,当改变一个位置p 的数时,把他所影响的区间(p,p+k-...

还我笑颜 157
上一篇: 【转】 POJ分类
下一篇: POJ 3308: Paratroopers
frog1902
博客等级 码龄14年 152粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值