D. Animals and Puzzle 题目连接: http://codeforces.com/contest/713/problem/D Description Owl Sonya gave a huge lake puzzle of size n × m to hedgehog Filya as a birthday present. Friends immediately started to assemble the puzzle, but some parts of it turn…
E. ALT http://codeforces.com/problemset/problem/786/E 题意: 给出一棵 n 个节点的树与 m 个工人.每个工人有一条上下班路线(简单路径),一个工人会得到满足只要下面一项满足:1.他得到一只puppy 2.他的上下班路径上每条边都有一只doge求使所有工人满足的最小dog数并输出方案.n≤20000,m≤10000 想法:暴力建图,源点连向工人Xi,边Yi连向汇点,容量为1.然后工人向其路径上的边连容量为1的边.O(nm) 优化建图:路径为树…