![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
文章平均质量分 81
外滩门市部
对题解有不理解的地方或者发现存在错误,欢迎在评论中留言告诉我。
展开
-
bzoj4262 Sum
题目大意给出一个随机数列 {An}\{A_n\},再给出 tt 组询问,每次询问左端点在 [l1,r1][l_1,r_1] 范围内,右端点在 [l2,r2][l_2,r_2] 范围内的所有区间的区间最大值和区间最小值之差的和。数据范围1≤t≤40000,1≤l1≤r1≤100000,1≤l2≤r2≤100000.1 \leq t \leq 40000, 1 \leq l_1 \leq r_1 \le原创 2017-04-25 12:17:00 · 384 阅读 · 0 评论 -
bzoj4540 序列
做法同bzoj4262#include <stdio.h> #include <string.h> #include <algorithm> using namespace std;int gint(){ char c; int f=1; while(c=getchar(),c<48||c>57) if(c=='-')f=-1; int x=0; fo原创 2017-04-25 12:50:54 · 230 阅读 · 0 评论