
树状数组与线段树
文章平均质量分 79
yihanyifan
所谓梦想,就是永不停息的疯狂
展开
-
D. Distinct Characters Queries
D. Distinct Characters Queriestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a stringssconsisting of lowercase ...原创 2019-10-03 16:41:53 · 280 阅读 · 0 评论 -
最全线段树例题
例题1: 给一个长度n的序列,对于每个询问 询问区间内最大连续和一、一个区间的最大子段和有三种情况1、左子区间的最大子段和2、右子区间的最大子段和3、横跨左右子区间二、每个结点需要维护的信息1、区间和sum2、从区间左端点开始的最大子段和lgss3、从区间右端点开始的最大子段和rgss4、区间最大子段和gss三、建树1、遇到叶子节点就...原创 2019-09-23 19:19:13 · 1027 阅读 · 0 评论 -
HDU 2795 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 ...原创 2018-08-02 22:49:49 · 119 阅读 · 0 评论 -
POJ 2528 线段树+离散化
The citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city council has finally d...原创 2018-07-31 19:44:14 · 118 阅读 · 0 评论 -
树状数组求逆序数
1、什么是逆序数?2、用树状数组求逆序数的总数 2.1该背景下树状数组的含义 2.2如何使用树状数组求逆序数总数 2.3 C++实现代码目录 1、什么是逆序数? 在一个排列中,如果一对数的前后位置与大小顺序相反,即前面的数大于后面的数,那么它们就称为一个逆序。一个排列中逆序数的总数就是这个排列的逆序数。...原创 2018-07-30 17:20:03 · 162 阅读 · 0 评论