Code: #include <cstdio> #include <algorithm> #include <string> #include <cstring> using namespace std; #define maxn 50005*256 #define ll long long int n,m,tree; struct SEGIN { int cnt; long long sumv[maxn],lazy[maxn]; int lson[maxn
3110: [Zjoi2013]K大数查询 Time Limit: 20 Sec Memory Limit: 512 MBSubmit: 6050 Solved: 2007[Submit][Status][Discuss] Description 有N个位置,M个操作.操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c如果是2 a b c形式,表示询问从第a个位置到第b个位置,第C大的数是多少. Input 第一行N,M接下来M行,每行形如1 a
传送门 一开始想的是区间线段树套权值线段树,结果好像不能实现. 然后题解是权值线段树套区间线段树. 区间线段树上标记永久化就省去了pushdown的操作减少常数. 标记永久化的话..yy不出来就看代码吧. 然后注意开long long #include <cstdio> #include <iostream> #include <algorithm> #define N 50010 #define LL long long using namespace std; in