codevs1285专题

codevs1285 宠物收养所 splayTree

删除节点时把它移到根节点,把它的后继移到根的右子节点,然后删除根。 #include<iostream>#include<cstring>#include<cstdio>#include<algorithm>#include<cmath>#define inf 1000000000using namespace std;const int maxn=200005;struct