CF387D George and Interesting Graph
题目描述
- 没有重边;
- 存在结点 $v$(称为中心),使得对于图中的任意结点 $u$,都有边 $(u,v)$ 和 $(v,u)$,注意自环 $(v,v)$ 也应该存在;
- 除去中心外,每个点的入度和出度都恰好为 $2$;
显然很少有图有趣,但 George 可以把图变得有趣:每次他可以增加一条边或者删除一条已经存在的边。
现在给出图 $G$,George 想知道他最少做多少次操作可以使它变得有趣。
输入格式
无
输出格式
无
说明/提示
For more information about directed graphs, please visit: http://en.wikipedia.org/wiki/Directed\_graph
In the first sample the graph already is interesting, its center is vertex $ 3 $ .