题目大意:同3673 强制在线
同3673 只不过慢了一些0.0
这道题只写路径压缩比只写启发式合并要快一点点 两个都写就慢的要死0.0
改代码RE的可能是内存不够
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define M 200200
using namespace std;
struct Tree{
Tree *ls,*rs;
int num;
}*fa[M],mempool[M*60],*C=mempool;
int n,m,ans,now,version[M],tot;
inline Tree* New_Node(Tree *_,Tree *__,int ___)
{
C->ls=_;
C->rs=__;
C->num=___;
return C++;
}
T......
阅读全文