https://www.nowcoder.com/practice/5427af99168b45f4a14aec195b28a839?tpId=98&&tqId=32999&rp=1&ru=/acti
#include#include#include#definemaxn100020#definemaxm200020usingnamespacestd;inttot=0,n;intfir[maxn],en[maxm],nex[maxm];intf[maxn][2];intfa[maxn];voidadd_edge(intx,inty){en[++tot]=y;nex[tot]=fir[x];fir