线段树TLE,只有30分 #include <bits/stdc++.h> using namespace std; #define int long long const int MAXN = 1e6+5; int N, M; long long K, D; struct Node { int l, r; long long lmx, rmx, mx, sum; } tr[MAXN * 4]; void pushup(int k) { int lc = k << 1; int rc = lc | 1; tr[k].lmx ...