似乎不能用sort那种方法,网上搜了几个但是error了,我写了这样的东西:
int cnt,fa[N],siz[N],hson[N],dep[N],top[N];
class greater{
public:
bool operator()(int a,int b){
return dep[a]<dep[b];
}
}
set<int,greater<int> > P[N];
结果:error: template argument 2 is invalid。
求修改,以及这个能不能用lambda写?