【Codeforces 723E】One-Way Reform

题目传送门:http://codeforces.com/contest/723/problem/E
官方题解:http://codeforces.com/blog/entry/47502

出度与入度相等 => 欧拉回路
有度数为偶数的点 => 两两配对之后加一条边
此时所有点的度数都为偶数,每一个连通子图存在欧拉回路
于是可以用随便定向,只有用网络流来的得出可行解

现在唯一的问题就是证明度数为奇数的点一定是偶数对了:
一条边贡献两个度 => 总度数为偶数
若度数为奇数的点有奇数个 => 总度数为奇数
矛盾 => 度数为奇数的点不可能有奇数个

One thought to “【Codeforces 723E】One-Way Reform”

  1. What i don’t understood is if truth be told how you are no longer actually much more well-favored than you might be now. You’re very intelligent. You already know therefore significantly in the case of this matter, produced me in my view imagine it from numerous numerous angles. Its like women and men are not fascinated until it’s one thing to accomplish with Girl gaga! Your individual stuffs excellent. Always maintain it up!

Leave a Reply

Your email address will not be published. Required fields are marked *