Rosetta Problems

木のパス上の ii 番目の頂点

木と QQ 個のクエリ (s,t,i)(s, t, i) が与えられ、ss から tt へのパス上で ss から ii 番目の頂点を求める。

関連リンク