Menagerie

F. Selling a Menagerie

F. Selling a Menagerie You are the owner of a menagerie consisting of $n$ animals numbered from $1$ to $n$. However, maintaining the menagerie is quit ......
Menagerie Selling

CF1872F Selling a Menagerie

## 思路 对于每一个动物,我们都尽量让它比它害怕的动物先被卖。 考虑拓扑排序,每次输出出度为 $0$ 的点,然后再删点删边。 但是 $n$ 个点,$n$ 条边,必然存在环,所以只用拓扑排序是不行的。 自然想到 tarjan 缩点,对于环外,就拓扑排序好了,对于一个环,显然无法满足所有的点,所以我们 ......
Menagerie Selling 1872F 1872 CF
共2篇  :1/1页 首页上一页1下一页尾页