数学解释不多说了,参考:http://blog.csdn.net/scorpiocj/article/details/6085637
最大权闭合图,最大权=sum-最小割,sum为所有正点权的和;要裁掉几个人,根据最小割的性质,被裁掉的人肯定不在最小割中,所以只要从源点开始对残留网络进行遍历即可。
注意一点,sum类型为long long,否则出错。
/*
* Dinic algo for max flow
*
* This implementation assumes that #nodes, #edges, and capacity on each edge <= INT_MAX,
* which means INT_MAX is the best approximation of INF on edge capacity.
* The total amount of max flow computed can be up to LLONG_MAX (not defined in this file),
* but each 'dfs' call in &