poj2464 线段树扫描线

.net core 下的PostgreSQL 异常排查—— Exception while reading from stream (0x80004005) 最近以PostgreSQL为存储介质,实现了分布式缓存的一个组件开发,在经过开发环境的测试后,顺利推送到产品组的手里,经过开发环境的验证后,终于发布到测试环境了,但问题来了,产品组反应频繁出现访问异常,返回的信息大致是:Exception while reading from stream … (0x80004005) ????欢迎点赞 :???? 收藏 ⭐留言 ???? 如有错误敬请指正,赐人玫瑰,手留余香! ????本文作者:由webmote 原创,首发于 【优快云】 ????作者格言: 生活在 阅读详情

由于这几天刚好有事,这题目拖了好几天,今天总算静下心来搞定了。题目并不难,只是有点繁琐,而且要注意细节。

简要思路:

先把数据离散化,同时记录每一个X左右边有多少,X有多少,Y同理;

然后按先X再Y从小到大排序,再来扫描,用线段树记录区间里点的个数。

然后推出四个象限的点的个数,麻烦的事来了,坐标上的点怎么去掉,开了cntx,cnty记录每个X,Y坐标询问次数,然后就很简单了。

最后把第二个人的结果排序再去重就OK了;


ACcode:

#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using std::sort;

const int nsize=222222;

struct Point
{
    int x,y;
} pot[nsize];

int n,k,nx,ny,maxs;
int maxy[nsize],num[nsize<<2];
int lft[nsize],rgt[nsize];
int up[nsize],down[nsize];
int curx[nsize],cury[nsize];
int *px[nsize],*py[nsize];
int cntx[nsize],cnty[nsize];

int Max(int a1,int a2)
{
    return a1>a2?a1:a2;
}

int Min(int a1,int a2)
{
    return a1<a2?a1:a2;
}

bool cmp1(int *a1,int *a2)
{
    return *a1<*a2;
}

bool cmp2(Point a1,Point a2)
{
    if (a1.x==a2.x) return a1.y<a2.y;
    return a1.x<a2.x;
}

void leave()
{
    int i,tx,ty;
    sort(px,px+n,cmp1);
    sort(py,py+n,cmp1);
    nx=ny=1;
    tx=*px[0],ty=*py[0];
    *px[0]=*py[0]=1;
    lft[0]=lft[1]=0;
    down[0]=down[1]=0;
    for (i=1; i<n; i++)
    {
        if (*px[i]!=tx)
        {
            tx=*px[i];
            curx[nx]=i-lft[nx];
            rgt[nx]=n-i;
            lft[++nx]=i;
        }
        *px[i]=nx;

        if (*py[i]!=ty)
        {
            ty=*py[i];
            cury[ny]=i-down[ny];
            up[ny]=n-i;
            down[++ny]=i;
        }
        *py[i]=ny;
    }
    rgt[nx]=up[ny]=0;
    curx[nx]=n-lft[nx];
    cury[ny]=n-down[ny];
}

int query(int rt,int l,int r,int L,int R)
{
    if (L<=l&&r<=R) return num[rt];
    int m=(l+r)>>1,ans=0;
    if (L<=m) ans+=query(rt<<1,l,m,L,R);
    if (R>m)  ans+=query(rt<<1|1,m+1,r,L,R);
    return ans;
}

void PushUp(int rt)
{
    num[rt]=num[rt<<1]+num[rt<<1|1];
}

void update(int rt,int l,int r,int p)
{
    if (l==r)
    {
        num[rt]++;
        return ;
    }
    int m=(l+r)>>1;
    if (p<=m) update(rt<<1,l,m,p);
    else update(rt<<1|1,m+1,r,p);
    PushUp(rt);
}

void solve()
{
    int i,tx,ty;
    int lu,ld,ru,rd;
    int mins=nsize,may=-1;
    maxs=0,k=0;
    sort(pot,pot+n,cmp2);
    memset(num,0,sizeof(num));
    memset(cntx,0,sizeof(cntx));
    memset(cnty,0,sizeof(cnty));
    for (i=0; i<n; i++)
    {
        tx=pot[i].x;
        ty=pot[i].y;
        lu=query(1,1,ny,ty+1,ny);
        ld=lft[tx]-lu-cnty[ty];
        rd=down[ty]-ld-cntx[tx];
        ru=up[ty]-lu-(curx[tx]-cntx[tx]-1);
        //      ru=n-curx[tx]-cury[ty]+1-ld-rd-lu;
        mins=Min(mins,ld+ru);
        may=Max(may,lu+rd);
        update(1,1,ny,ty);
        cntx[tx]++;
        cnty[ty]++;
        if (i==(n-1)||(tx!=pot[i+1].x))
        {
            if (maxs<mins)
            {
                maxs=mins;
                maxy[0]=may;
                k=1;
            }
            else if (maxs==mins)
                maxy[k++]=may;
            mins=nsize,may=-1;
        }

    }
    printf("Stan: %d; Ollie:",maxs);
    sort(maxy,maxy+k);
    for (ty=i=1; i<k; i++)
        if (maxy[i]!=maxy[i-1]) maxy[ty++]=maxy[i];
    for (i=0; i<ty; i++) printf(" %d",maxy[i]);
    puts(";");
}

int main()
{
    int i;
    while (scanf("%d",&n)&&n)
    {
        for (i=0; i<n; i++)
        {
            scanf("%d %d",&pot[i].x,&pot[i].y);
            px[i]=&pot[i].x,py[i]=&pot[i].y;
        }
        leave();
        solve();
    }
    return 0;
}



PCL SAC-IA 初始配准算法【2025最新版】 采样一致性初始配准算法,简称SAC_IA。博客长期更新,本文最新更新时间为:2025年1月1日。新增参数设置建议 阅读详情

相关推荐

《21天学通C++》阶段性成果测试题——hstring(手写string类)

总体考察了类的使用,缓冲区考察了指针和数组的使用、增删改查、考察编码思维、考察了类的重载。1.初始化子字符串的起始位置为-1,表示未找到,若buffer或findHstring为空,则返回-1。右边的字符串不为空,则分别获取母串和子串的长度(用循环),然后创建一个固定大小的数组。3.然后循环遍历寻找子串在母串中的起始位置,循环时可以通过两个长度相减,避免循环越界。2.如都不为空,则分别获取双方的字符串长度(用循环),然后。右边的字符串为空,则输出原来的字符串。是否为空,有一方为空则返回另一方。

立志成为炼丹师? 1263

POJ 2464 Brownie Points II(树状数组)

题目链接:http://poj.org/problem?id=2464 题意:平面上有n个点。Stan选一个点A画一条垂线经过A(x值与A相同的点也会被穿过),Ollie在这条垂线所穿过的点中选一个点B用一条水平线穿过它,这样把平面分到四个区域,Stan的得分为右上和左下的点的个数,Ollie为右下和左上的点的个数。Stan先画。Stan选点的策略是使得在Ollie画完后(Ollie可能有好多选...

weixin_34236869的博客 182

基于PSO-BP神经网络的风电功率预测研究论文复现

风电功率预测。基于PSO-BP神经网络的风电功率预测论文复现。matlab程序,注释清晰。

weixin_825487230的博客 2294

poj 2464(离散化+BIT)

不得不说是一道比较烦人的题。。细节比较多 由于没给xy范围所以必须先离散化。。之后再开2个BIT,以y值为下标维护点的个数,在枚举x时,一个BIT维护x左边的点个数,另一个维护x右边的点,然后在枚举的时候主要按点对BIT进行维护,对每个点进行差分求方案,对每个x求得最优方案后还要记录方案来求oli的得分。。 然后记得输出oli得分要去重。。 #include #include

qkoqhh 364

JW01二氧化碳传感器实战:5分钟搞定Arduino环境监测系统(附完整代码)

本文详细介绍了如何使用JW01二氧化碳传感器与Arduino快速搭建环境监测系统。通过简单的硬件连接和完整的代码示例,读者可以在5分钟内实现CO2浓度实时监测,并了解数据解析、常见问题解决及进阶应用扩展。JW01传感器的高精度和易用性使其成为创客和嵌入式开发者的理想选择。

kite3的博客 381

#1机器学习(西瓜书)自学记录

《机器学习 》 Datawhale 组队学习, 吃瓜自学笔记。

qq_74168740的博客 1148

【Poj】2464 (线段树)

题目:平面上有若干个点,stan过其中某个点划一条垂直x轴的线(可同时过多个点),ollie过stan画的线中的某个点,画一条垂直与y轴的线,这时候将平面分为4个区域,stan的得分为第一象限和第三象限的个数,olle反之。 现在题目的要求来了,有点绕:题目要求在stan画下的一条直线之后,ollie可以获得的最高分,stan获得一个分数x,最后x最大的时候,将ollie的分数输出。 思路就不

Jason 610

71、机器人与机器人控制器技术解析

本文深入解析了机器人控制器的通信接口、传感器数据采集与处理以及抓手技术三大核心技术。详细介绍了数字I/O、串行接口、总线系统和以太网等通信方式,探讨了各类传感器在焊接、装配、质量检测等场景中的应用,并阐述了手眼校准与路径校正的关键方法。同时,文章还分析了不同类型抓手的特点及选型设计原则,展示了机器人在现代工业自动化中的高效性与灵活性。通过实际编程示例与流程图,全面呈现了机器人系统的集成与控制逻辑。

gin88的博客 275

POJ 2464 Brownie Points II(树状数组)

题解:#include<set> #include<map> #include<queue> #include<stack> #include<cmath> #include<vector> #include<string> #include<cstdio> #include<cstring> #include<stdlib.h> #include<iostream> #include<algori

专注如一的博客 548

Win10系统怎么打开Microsoft帐户?Win10系统打开Microsoft的帐户方法

也被加入了越来越多的功能,我们在使用电脑的时候,很对用户会打开Micorsofy账户功能,搜索个人邮件信息,照片等等,还能将个人的数据备份到账户内,那要怎么打开账户呢,下面带给大家方法。以上就是小编给大家整理的win10系统打开Microsoft帐户的具体操作方法,方法简单易懂,有需要的朋友可以看一看,希望这篇教程对大家有所帮助。5、最后我们将“Microsoft帐户”选项下方的开关按钮向右滑动将其打开,如下图所示,这样就成功打开wMicrosoft帐户功能了。我们在窗口左侧点击“设置”选项即可。

2401_88800025的博客 278

三维点云转深度图

点云投影过程是将三维点云数据转化为二维图像坐标的关键步骤,它的实现涉及到相机内外参数的计算,包括相机的内部参数(如焦距和主点)和外部参数(如相机位置和方向)。具体来说,可以通过将每个点的三维坐标转换为相机坐标系下的坐标,然后使用相机内部参数和外部参数来计算在二维图像中的坐标。接着计算每个点的深度值,将深度值映射到像素值上,最后创建深度图像并将深度值赋给对应的像素值。这里需要注意的是,在将深度值映射到像素值上时,需要将像素值转换为 uchar 类型,否则在将深度值赋给像素值时会出现类型不匹配的错误。

点云兔子的博客 3171

poj 2464(区间更新)

题意:给出n个点的坐标,Stan和Ollie玩游戏,Stan会先选一个点过这个点画一条竖直的线,然后Ollie会在这条竖直的线上过一个点画一条横线,然后平面分成了四部分,Stan会将第一和第三象限上的点的数量作为自己的分数,Ollie会将第二和第四象限上的点的数量作为自己的分数,线上的点不计,Stan会采用让自己最小分数最大的方案去选择画竖线,Ollie会选择让自己分数更多的方案划线,要求输出Sta

俯瞰风景 635

【WRF-Urban】使用 CGLC-MODIS-LCZ_100m 数据集运行 WRF 时的城市参数化问题

【WRF-Urban】使用 CGLC-MODIS-LCZ_100m 数据集运行 WRF 时的城市参数化问题

WW、forever的博客 709

POJ 2464 Brownie Points II(线段树:扫描线)

POJ 2464 Brownie Points II(线段树:扫描线) http://poj.org/problem?id=2464 题意:平面上有很多点,然后stan通过一个点画了一条竖线,ollie通过已经被该竖线穿过的点画了一条横线.现在平面被分成了4个象限了.stan获得的分数是1,3象限的点数,ollie获得的分数是2,4象限的点数.由于stan先画竖线,他可以保证在让自己可能获得的

code 1401

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

POJ 2464 Brownie Points II(扫描线 + 两棵线段树 区间求和)

题意: stan 划了一条竖线,ollie在这条线的基础上划一条横线,使自己能拿到的蛋糕尽可能的多。 思路: 1. 对于 y 坐标离散化,扫描线是垂直 x 轴的,从左向右:首先对 rtree 存放所有蛋糕,ltree 存放扫描线左边的蛋糕数,于是初始置 0 2. 假设离散化后 y 的点数有 m 个,代码中为了方便 query 操作,区间是 [0, m],每个线段树节点代表 y 坐...

weixin_30708329的博客 149

深度学习工具包 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 2464 Brownie Points II (扫描线)

题意:在平面直角坐标系中给你N个点,stan和ollie玩一个游戏,首先stan在竖直方向上画一条直线,该直线必须要过其中的某个点,然后ollie在水平方向上画一条直线,该直线的要求是要经过一个stan之前画过的点。 这时候平面就被分割成了四块,两个人这时候会有一个得分,stan的得分是平面上第1、3象限内的点的个数,ollie的得分是平面上第2、4象限内的点的个数,在统计的时候在所画线上的点都不

2600

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

poj2464扫描线好题,树状数组解法

用树状数组解比线段树快了好多,难度也下降许多 分别用两个树状数组维护当前扫描线左侧和右侧的点,离散化y轴即可 #include<iostream> #include<cstring> #include<cstdio> #include<algorithm> #include<vector> using namespace...

weixin_30387663的博客 152

poj2464扫描线好题,回头再做

扫描线+区间更新 题解 /* st[i],ol[i]表示y坐标大于y[i]和小于y[i]的点 两颗线段树建立在y轴上,区间[l,r]ol线选在[l,r]时st的分数 每次查询完成后再更新一次 遍历每条st线上的ol线,这是单点查询 */ #include<iostream> #include<cstring> #include<cstdio&g...

weixin_30457065的博客 116

线段树练习题集

线段树题目整合 1.hdu1166 敌兵布阵 更新节点,区间求和。 2.hdu1754 I Hate It 更新节点,区间最值. .3.hdu1698 Just a Hook 成段更新,总区间求和. .4.hdu1394 Minimum Inversion Number 更新节点,区间求和 .5.hdu1779(这个爆炸了,别做了) 成段更新,区间最值 .6.pku...

UncleJokerly 2471

【专题】线段树

单点更新 最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来。 hdu1166 敌兵布阵 线段树 hdu 1166 敌兵布阵 单点更新区间求和 hdu1754 I Hate It 线段树 hdu 1754 I Hate It 单点更新 区间求最值 hdu1394 Minimum Inversion Number hdu 1394

Azarath Metrion Zinthos 1091

线段树专题

最最基础的线段树,只更新叶子节点,然后把信息用PushUP(int r)这个函数更新上来。 hdu1166 敌兵布阵 线段树 hdu 1166 敌兵布阵 单点更新区间求和 hdu1754 I Hate It 线段树 hdu 1754 I Hate It 单点更新 区间求最值 hdu1394 Minimum Inversion Number hdu 1394 Minimum Invers

SeeYouAlways 645

NotOnlySuccess 大牛的线段树的题目

以下是大牛给出的练习题。单点更新: 1. hdu 1166 敌兵布阵 2. hdu 1754 I Hate it 3. hdu 1394 Minimum Iversion Number 4. hdu 2795 Billboard 5. poj 2828 Buy Tickets 6. poj 2886 Who Gets the Most Candies?成段更新: 1. hdu 1698

Where amazing happens 884

线段树入门记录

大牛的入门博客 大牛给的题目 单点更新: hdu 1166 敌兵布阵 hdu 1754 I Hate it hdu 1394 Minimum Iversion Number hdu 2795 Billboard poj 2828 Buy Tickets poj 2886 Who Gets the Most Candies? 成段更新: hdu 1698 ...

weixin_34296641的博客 83

poj2464 Brownie Points II

题意:在平面直角坐标系中给你N个点,stan和ollie玩一个游戏,首先stan在竖直方向上画一条直线,该直线必须要过其中的某个点,然后ollie在水平方向上画一条直线,该直线的要求是要经过一个stan之前画过的点。 这时候平面就被分割成了四块,两个人这时候会有一个得分,stan的得分是平面上第1、3象限内的点的个数,ollie的得分是平面上第2、4象限内的点的个数,在统计的时候在所画线上的点都不

u010485714的专栏 592

【poj2464 Brownie Points II】(树状数组+离散化【好题】)

链接:http://poj.org/problem?id=2464题意:平面上有若干点,stan通过一个点划了一条直线,ollie通过在这条垂直直线上的点作了一条水平线,平面被分成4个象限,定义stan获得的分数为1,3象限的点的数量,ollie获得的分数为2,4象限上的点的数量,线上的点不归任何人所有。两人都采用最优的策略使自己获得的点数最大。由于stan的选择具有主动权,为了对自己有利,求st...

running_acmer的博客 453

poj2464Brownie Points II(树状数组)

晚上写了好久,终于把奇丑无比的代码改好了,试了几个样例都没问题,然后1A,真舒服 题目大意就是坐标平面上给N个点,然后先是Stan经过一个点做一条竖线,随之Ollie在Stan所做竖线上所有的点中选一个点做一条横线,两条线将平面分为四块, Stan的得分是右上和左下两块中点数之和,Ollie得分是左上和右下两块中点数之和,在直线上的点统统不计 最关键的是:两个人都想让自己的得分尽量高,然后输

T__TSZ的博客 455
上一篇: STL vector基本用法
下一篇: hdu 1024 最大m子段和
丿Smile灬晨星
博客等级 码龄14年 46粉丝 235原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值