题面中 No two cowpaths connect the same two pastures, and no path connects a pasture to itself (a_i != b_i). 未给出翻译,应翻译为 保证图中没有重边和自环 并放到题目描述最后。可以发现,这会影响实现细节。 麻烦管理员帮忙更正,thx。
No two cowpaths connect the same two pastures, and no path connects a pasture to itself (a_i != b_i).
保证图中没有重边和自环