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…
题目链接 洛谷 bzoj 题解 整体二分 Code #include<bits/stdc++.h> #define LL long long #define RG register using namespace std; inline int gi() { RG int x = 0; RG char c = getchar(); bool f = 0; while (c != '-' && (c < '0' || c > '9')) c = getchar();…