![](https://img-blog.csdnimg.cn/20190927151026427.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
线段树
117瓶果粒橙
这个作者很懒,什么都没留下…
展开
-
HDU2795 Billboard 线段树
Problem DescriptionAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcements ...原创 2019-04-08 23:33:46 · 168 阅读 · 0 评论 -
HDU 3911 Black and White 线段树(区间合并) 模板题
Problem DescriptionThere are a bunch of stones on the beach; Stone color is white or black. Little Sheep has a magic brush, she can change the color of a continuous stone, black to white, white to b...原创 2019-04-10 00:17:46 · 220 阅读 · 0 评论 -
HDU 1394 暴力 / 线段树
题意:给你一个n个数的序列,其中组成的数只有0-n,我们可以进行这么一种操作:把第一个数移到最后一个,次数不限。问,在原始数列和最新生成的数列中逆序数最小可以是多少?暴力是可以过的。当然是,只暴力求原序列的逆序对,通过递推求新序列的逆序对数。递推关系是这样子的:首先要明白将第一个数移到最后一个,其逆序数的变化是在前一个逆序数n的基础上这样变成。因为这是一个0 ~ n-1地全排列,所以l...原创 2019-04-07 20:47:26 · 123 阅读 · 0 评论 -
HDU 1754 线段树(单点),维护最大值
区间查询,写的时候出了点小问题。index和mid的对应关系,一不小心写错了。维护最大值和维护区间和的不同,在Query( )函数中,ans的更新方式。//AC//HDU 1754 线段树 维护最大值//单点查询和修改 #include<iostream>#include<algorithm>#include<cstring>#in...原创 2019-04-06 12:44:21 · 97 阅读 · 0 评论 -
线段树模板整理 HDU1166 POJ3468
这两道题,都是裸的线段树,并且线段树维护的都是区间和。放在一起整理一下,毕竟之前只是按照板子敲过。HDU 1166----单点修改,区间查询(小声哔哔:用区间来代替单点,一样能A的。毕竟原理都一样。在Add()函数和update( )函数那里,就是if-else的区别?)//ac 单点修改 //HDU 1166 second#include<iostream>...原创 2019-04-06 11:51:04 · 123 阅读 · 0 评论