int find(int x){ if(x==p[x])return x; return p[x]=find(p[x]); }
//↑第一种是我在题解看到的写法,AC了
int find(int x){ if(x!=p[x])return find(p[x]); return p[x]; }
//↑第二种是acwing上y总教的,但是TLE了