洛谷
将每个点拆成(d)个,(ulongrightarrow vLongrightarrow (u,i)longrightarrow (v,i\%d+1))
结论1:(i eq j),若((u,i))能走到((u,j))则((u,j))也能走到((u,i))
证明: 令(x=|j-i|),则((u,j))能走到((u,j+x))
将图缩点,然后在DAG跑dp