#include<cstdio> #include<algorithm> #include<cstring> #define N 80010 #define which(x) (ls[fa[(x)]]==(x)) using namespace std; int id[N],pos[N],sz[N],ls[N],rs[N],fa[N],tot,n,m,root,a[N]; ]; +sz[ls[x]]+sz[rs[x]];} int Build(int l,int r,i…
Pollard-Rho 模板 板题-没啥说的- 求逆元出来后如果是负的记得加回正数 CODE #include<bits/stdc++.h> using namespace std; typedef long long LL; queue<int>arr; inline LL multi(LL a, LL b, LL p) { //快速乘 LL re = a * b - (LL)((long double) a / p * b + 1e-8) * p; return re <…