
线段树
似火orz
哈哈哈哈哈哈哈哈哈哈
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
线段树
板子题---单点更新,区间和 #include<iostream> #include<cstdio> #include<cmath> using namespace std; #define ll long long //注意点的位置要对应,下文都要以rt,l,r为顺序 #define m ((l+r)>>1) #define lson rt&l...原创 2019-04-09 15:44:22 · 164 阅读 · 0 评论 -
B - Minimum HihoCoder - 1586 --线段树
题目链接 题意:给出一个k,输入2^k个数,然后下面一行操作,1代表询问,询问L-R区间中ax*ay的最小值(x可以等于y) 2代表更改,将第L个数改为R,每次遇到询问就输出对应区间乘积的最小值。 思路:暴力搜索肯定会超时,所以这里我们用线段树 直接相乘太麻烦,所以这里我们搜索出区间最大最小值,然后判断正负情况,输出相应的答案 1 如果最大值最小值都是正数,用最小值*最小值 2 如果两...原创 2019-04-09 17:39:18 · 158 阅读 · 0 评论 -
Mayor's posters -线段树区间更新+离散化
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...原创 2019-04-19 17:28:48 · 183 阅读 · 0 评论