hdu 1823 Luck and Love(二维线段树)

UG二次开发避坑指南:如何正确配置Python环境让NXOpen脚本跑起来? 本文详细介绍了UG/NX二次开发中Python环境配置的全流程与NXOpen脚本调试技巧,帮助开发者避开常见陷阱。从NXOpen架构解析到Python解释器版本匹配,再到环境变量设置与路径问题处理,提供了一套经过验证的配置方案,确保脚本顺利运行。 阅读详情

Luck and Love

Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 6285    Accepted Submission(s): 1587


Problem Description
世界上上最远的距离不是相隔天涯海角
而是我在你面前
可你却不知道我爱你
                ―― 张小娴

前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―|||
由于人数太多,Wiskey实在忙不过来,就把统计的事情全交给了枫冰叶子,自己跑回家休息去了。这可够枫冰叶子忙的了,他要处理的有两类事情,一是得接受MM的报名,二是要帮Wiskey查找符合要求的MM中缘分最高值。
 

Input
本题有多个测试数据,第一个数字M,表示接下来有连续的M个操作,当M=0时处理中止。
接下来是一个操作符C。
当操作符为‘I’时,表示有一个MM报名,后面接着一个整数,H表示身高,两个浮点数,A表示活泼度,L表示缘分值。 (100<=H<=200, 0.0<=A,L<=100.0)
当操作符为‘Q’时,后面接着四个浮点数,H1,H2表示身高区间,A1,A2表示活泼度区间,输出符合身高和活泼度要求的MM中的缘分最高值。 (100<=H1,H2<=200, 0.0<=A1,A2<=100.0)
所有输入的浮点数,均只有一位小数。
 

Output
对于每一次询问操作,在一行里面输出缘分最高值,保留一位小数。
对查找不到的询问,输出-1。
 

Sample Input
8 I 160 50.5 60.0 I 165 30.0 80.5 I 166 10.0 50.0 I 170 80.5 77.5 Q 150 166 10.0 60.0 Q 166 177 10.0 50.0 I 166 40.0 99.9 Q 166 177 10.0 50.0 0
 

Sample Output
80.5 50.0 99.9

解题思路:

    二维线段树入门题,直接用二维线段树模板就行。

代码:

#include <iostream>
#include <stdio.h>
#include <algorithm>

using namespace std;

struct node{
    double maxL;
    int l,r;
};

struct nodeH{Luck and Love
    int l,r;
    node subTree[4105];
};

nodeH tree[805];
int n;

void buildTreeA(int rootH,int root,int l,int r){
    tree[rootH].subTree[root].l = l;
    tree[rootH].subTree[root].r = r;
    tree[rootH].subTree[root].maxL = -1;
    if(l != r){
        int mid = (l + r)/2;
        buildTreeA(rootH,2*root,l,mid);
        buildTreeA(rootH,2*root+1,mid+1,r);
    }
}
void buildTreeH(int root,int hl,int hr,int al,int ar){
    tree[root].l = hl;
    tree[root].r = hr;
    buildTreeA(root,1,al,ar);
    if(hl != hr){
        int mid = (hl + hr)/2;
        buildTreeH(2*root,hl,mid,al,ar);
        buildTreeH(2*root+1,mid+1,hr,al,ar);
    }
}

void insertA(int rootH,int root,int a,double l){
    if(tree[rootH].subTree[root].l == a && tree[rootH].subTree[root].r == a){
        if(tree[rootH].subTree[root].maxL < l) tree[rootH].subTree[root].maxL = l;
        return;
    }
    int mid = (tree[rootH].subTree[root].l + tree[rootH].subTree[root].r)/2;
    if(a <= mid){
        insertA(rootH,2*root,a,l);
    }
    else{
        insertA(rootH,2*root+1,a,l);
    }
    tree[rootH].subTree[root].maxL = max(tree[rootH].subTree[2*root].maxL,tree[rootH].subTree[2*root+1].maxL);
}

void insertH(int root,int h,int a,double l){
    insertA(root,1,a,l);
    if(tree[root].l == h && tree[root].r == h){
        return;
    }
    int mid = (tree[root].l + tree[root].r)/2;
    if(h <= mid){
        insertH(2*root,h,a,l);
    }
    else{
        insertH(2*root+1,h,a,l);
    }
}

double queryA(int rootH,int root,int al,int ar){
    if(tree[rootH].subTree[root].l == al && tree[rootH].subTree[root].r == ar){
        return tree[rootH].subTree[root].maxL;
    }
    int mid = (tree[rootH].subTree[root].l + tree[rootH].subTree[root].r)/2;
    if(ar <= mid){
        return queryA(rootH,2*root,al,ar);
    }
    else if(al > mid){
        return queryA(rootH,2*root+1,al,ar);
    }
    else{
        return max(queryA(rootH,2*root,al,mid),queryA(rootH,2*root+1,mid+1,ar));
    }
}

double queryH(int root,int hl,int hr,int al,int ar){
    if(tree[root].l == hl && tree[root].r == hr){
        return queryA(root,1,al,ar);
    }
    int mid = (tree[root].l + tree[root].r)/2;
    if(hr <= mid){
        return queryH(2*root,hl,hr,al,ar);
    }
    else if(hl > mid){
        return queryH(2*root+1,hl,hr,al,ar);
    }
    else{
        return max(queryH(2*root,hl,mid,al,ar),queryH(2*root+1,mid+1,hr,al,ar));
    }
}

int main()
{
    char s[5];
    double a,l,al,ar;
    int h,hl,hr;
    while(scanf("%d",&n) != EOF){
        buildTreeH(1,100,200,0,1000);
        if(!n) break;
        for(int i = 0; i < n; i ++){
            scanf("%s",s);
            if(s[0] == 'I'){
                scanf("%d%lf%lf",&h,&a,&l);
                insertH(1,h,(int)(a*10),l);
            }
            else{
                scanf("%d%d%lf%lf",&hl,&hr,&al,&ar);
                if(hl > hr) swap(hl,hr);
                if(al > ar) swap(al,ar);
                double ans = queryH(1,hl,hr,(int)(al*10),(int)(ar*10));
                if(ans == -1) printf("-1\n");
                else printf("%.1lf\n",ans);
            }
        }
    }
    return 0;
}


从叶片之舞到数据之眼:净空雷达如何重塑风电安全与效率的边界 净空雷达通过激光或毫米波技术实现风机叶片与塔筒间距离的毫米级实时监测,极大提升了风电场在极端天气下的安全性与运营效率。这项技术不仅预防扫塔事故,还通过数据可视化与智能分析赋能叶片健康管理和发电优化,成为风电数字化运维的核心基础设施。 阅读详情

相关推荐

TCP Reno/CUBIC 拥塞控制算法对比:从 Tahoe 到 BBR 的 4 种核心策略演进

本文深入解析了TCP拥塞控制算法的演进历程,从经典的Tahoe、Reno到现代的CUBIC和BBR,详细对比了4种核心策略的实现机制与性能差异。通过分析拥塞窗口、流量控制等关键技术,揭示了不同算法在高带宽延迟网络中的优化方向,为网络协议栈优化提供理论依据和实践指导。

weixin_33725239的博客 440

【hdu1823】【二维线段树】Luck and Love

这道题是一道二维线段树的裸题。 由于浮点数最多一位,所以我们可以先转化成整数,输出时除以10;另外当两个人身高和活泼度都相等时,要取魅力值大的一个,所以要取最大而不能直接赋值。 代码: #include #include #include using namespace std; const int maxn1 = 100 + 10; const int maxn2 = 1000 + 1

I'm dreamer 628

国内网络环境下Leaflet加载OpenStreetMap地图的5种替代方案(附可用瓦片地址)

本文针对国内网络环境下Leaflet加载OpenStreetMap地图的常见问题,提供了5种可用的瓦片替代方案,包括OpenStreetMap.fr HOT、OpenStreetMap.de、CartoDB、Stamen和Thunderforest,并附上详细的代码示例和选择建议,帮助开发者解决地图加载问题。

qsc901234的博客 1694

hdu1823 Luck and Love 二维线段树

首先发表下做完后的感受:这题真他妈操蛋!!!一个简单的二维线段树,搞了一下午啊啊。。 思路:首先根据身高建一棵线段树,然后在每个节点上再以活泼度建一棵线段树,并记录每个区间的最大缘分值。 重点说细节了:在查询时可能会有A1>A2,H1>H2;然后就是插入数据时可能会有缘分值为0的数据,所以初始化时不要初始化为0;可能会插入身高和活泼度相同但缘分值不同的数据,因此还需要比较一下;最后一点,我写(

程序猿之路 1303

NVIDIA GPU任务调度全景:从Block分配到Warp发射

GPU并行计算的核心是任务调度,而CUDA kernel在GPU上的执行并非简单的一次性操作,而是经过从CPU命令队列到硬件前端,再到GigaThread引擎和Warp Scheduler的多层协同。理解这一过程,是性能优化的基础。Warp作为硬件调度的基本单位,其状态切换与延迟隐藏能力直接决定计算单元的利用率;而Occupancy作为衡量SM上活跃Warp池大小的指标,也并非越高越好,需要结合访存模式与资源占用综合判断。对于多任务并发场景,Stream优先级、计算抢占、MIG硬件隔离与MPS软件共享等机制

weixin_32612263的博客 270

【目录】专栏文章导航

从最强工具链Davinci Configurator模块学习出发掌握AUTOSAR

weixin_47571898的博客 3295

hdu 1823 Luck and Love 二维线段树

第一次写二维线段树,题目算是简单,就是很多的陷阱; 题意比较的简单,就不说了; 二维线段树:就是在线段树里面嵌套一个线段树,可是由于结构的原因,一层线段树必须更新到底。如果各位大神有在一维不更新到底的方法,请提出来,我一定改正! 代码: #include #include #include #include using namespace std; #define maxn 1

wenjie2012的专栏 489

C# HttpClient完全攻略:从入门到精通只需5步

HttpClient是.NET框架中用于发送HTTP请求和接收HTTP响应的类。它基于异步编程模型,使得网络操作更加高效和灵活。

java专栏 1579

【二维线段树】 HDU 1823 Luck and Love | HDU 4819 Mosaic

【HDU 1823   Luck and Love】 原题直通车:HDU 1823 Luck and Love 题意:成块(矩形)更新最大值 代码: #include #include #include #include #define Lson L, mid, rt<<1 #define Rson mid+1, R, rt<<1|1 #define Mid (L+R)>>1 using

PWZER 1328

发那科 Fanuc PLC 报文通讯,报文解析。附源程序

发那科 Fanuc PLC 报文通讯,最详细的发那科 PLC报文解析,不再局限在官方提供的库,也不用再局限在windows平台。

ITOfDragon的博客 1747

Oracle EBS GL日记账批“选定以过账”状态数据修复

日记账来源:应收账款。用户操作过账以后,自动提交请求“过账:单一分类账”一直运行中,该请求执行5,6个小时甚至10多个小时无法完成,导致“标准管理器”阻塞大量请求待定,“冲突解决管理器”的待定数量不断增加。系统管理员不得不把该请求强制取消,此时,日记账批的状态处于“选定以过账”(GL_JE_BATCHES.STATUS为S),如下图 检查此日记账批有3千多条日记账题头,由于日记账比较多,日记账的科目余额计算需要大量服务器资源和执行时间比较长。

陈显平的专栏-Oracle EBS 3245

HDU 1823 Luck and Love(二维线段树)

//4681418 2011-09-30 12:26:14 Accepted 1823 140MS 7520K 3762 B C++ nkhelloworld //4681419 2011-09-30 12:26:40 Accepted 1823 203MS 7588K 3762 B G++ nkhelloworld /* 二维线段树,一个线段树中套一个线段树,求区间最大值 ...

169

华为od 面试八股文_Android安卓_05_含答案

华为od 面试八股文_Android安卓_05_含答案

MISAYAONE的博客 950

[hdu1823]Luck and Love(二维线段树)

解题关键:二维线段树模板题(单点修改、查询max) #include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<iostream> #include<cmath> using namespace std; ...

weixin_30664539的博客 89

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

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

HDU 1823 Luck and Love (二维线段树模板)

Luck and Love Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6435    Accepted Submission(s): 1637 Problem Description 世界上上最远的距离不是相隔天涯

LiQiyao的博客 418

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

二维线段树 hdu 1823 ——luck and love

小w征婚,收到很多女生报名,小w想找出其中符合要求的最有缘分的人。

2301_80093604的博客 344

STM32F407中文手册

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

HDU1823 Luck and Love, 二维线段树

注意几个问题 存在两个人, 高度和活泼度一样的话, 取最大值注意输入数据, 卡精度H1>H2, A1>A2g++如果过不了的话, 试一下C++ /******************************************************************************* # Author : Neo Fung # Email : neosfung@

Neo Fung的专栏 894

hdu 1823 Luck and Love ,二维线段树

Luck and Love Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5282    Accepted Submission(s): 1324 Input 本题有多个测试数据,第一个数字M,表示接下来有连续的M个操

天亮说晚安 1963

HDU-1823-Luck and Love-二维线段树入门

http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=14799 题意: Luck and Love Time Limit: 1000MS   Memory Limit: 32768KB   64bit IO Format: %I64d & %I64u Su

缺氧 446

HDU - 1823 Luck and Love (二维线段树)

世界上上最远的距离不是相隔天涯海角 而是我在你面前 可你却不知道我爱你 ―― 张小娴 前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―||| 由于人数太多,Wiskey实在忙不过来,就把统计的事情全交给了枫冰叶子,自己跑回家休息去了。这可够枫冰...

1999 211

HDU 1823 Luck and Love 二维线段树

Problem Description 世界上上最远的距离不是相隔天涯海角 而是我在你面前 可你却不知道我爱你                 ―― 张小娴 前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―||| 由于人数太多,Wiskey实在忙不过来,就把统计的事情全

旧时光 1304

hdu 1823 Luck and Love 二维线段树

代码:

冷月之殇 708

HDU - 1823 Luck and Love结题报告(二维线段树)(模板)

目录题目概述思路分析完整代码 题目概述 链接:https://vjudge.net/problem/HDU-1823 思路分析 第一道二维线段树。 因为涉及到升高和活泼度两个变量,所以需要二维线段树维护。因为活泼度和缘分值都是浮点数,因为不想存浮点数,所以*10变成整数。 其实二维线段树就是树套树,我们的思路就是:先把当作一个一维的线段树,先找出要更新的或者访问的节点的第一个坐标,之后再用相同的方...

nagisa2019的博客 268

HDU 1823 Luck and Love 二维线段树(树套树)

点击打开链接 Luck and Love Time Limit: 10000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5460    Accepted Submission(s): 1364 Problem Descriptio

代码改变世界,keep coding。 1656

HDU1823 Luck and Love(二维线段树单点更新+区间查询+模板)

世界上上最远的距离不是相隔天涯海角 而是我在你面前 可你却不知道我爱你 ―― 张小娴 前段日子,枫冰叶子给Wiskey做了个征婚启事,聘礼达到500万哦,天哪,可是天文数字了啊,不知多少MM蜂拥而至,顿时万人空巷,连扫地的大妈都来凑热闹来了。―_―||| 由于人数太多,Wiskey实在忙不过来,就把统计的事情全交给了枫冰叶子,自己跑回家休息去了。这可够枫冰叶子忙的了,他要处理的有两类事情,一是得接受MM的报名,二是要帮Wiskey查找符合要求的MM中缘分最高值。

HJY 692

HDU 1823 Luck and Love 二维线段树 / 矩形树

题意: 本题有多个测试数据,第一个数字M,表示接下来有连续的M个操作,当M=0时处理中止。接下来是一个操作符C。当操作符为‘I’时,表示有一个MM报名,后面接着一个整数,H表示身高,两个浮点数,A表示活泼度,L表示缘分值。 (100 题解: 注意浮点数的处理,一般来说可以离散化,或者化作整数处理。 二维线段树,第一维度的每一个节点都包含第二维度的一颗线段树。这种方式对于更高的维度就不是

1503
上一篇: hdu 1667 The Rotation Game(IDA*)
下一篇: hdu 1520 Anniversary party(树形dp)
accelerator_2016
博客等级 码龄11年 3粉丝 24原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值