• 2024-07-22luoguP3398 仓鼠找 sugar
    思路图论,最简单的解法:LCA加路径长度判断不等式代码#include<bits/stdc++.h>usingnamespacestd;constintN=100010;intf[N][25],d[N],dis[N],T,n,m,tot,t,ver[2*N],next1[2*N],head[N];queueq;voidadd(intx,inty){ver[++tot]=y;next1[tot]