线段树+平衡树 我!又!被!卡!常!了! 以前的splay偷懒的删除找前驱后继的办法被卡了QAQ 放一个在洛谷开O2才能过的代码..我太菜了.. #include <bits/stdc++.h> #define INF 2147483647 #define rint register int #define full(a, b) memset(a, b, sizeof a) using namespace std; typedef long long ll; inline int lowbit…
#include<cstdio> #include<ctime> #include<cstdlib> #include<iostream> #define M 3000009 using namespace std; struct shu { int l,r,sum1,zhi,dui,sum2; }a[M]; int n,root[M],size,ans,b[M],m; void you(int &a1) { int t=a[a1].l; a[a1]…