注意写代码的时候上下限要定的大一些,避免数据比较夸张,最好直接用long long进行运算
原题
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5 + 10;
const int INF = 0x3f3f3f3f3f;
int n, m;
struct Node{
int l, r;
int maxn;
}tr[N * 4];
int w[N];
void push_up(int u){
tr[u].maxn