题目链接: http://acm.hust.edu.cn/vjudge/problem/129727 D - Book Club Time Limit: 5000MS 题意 给你一个无自环的有向图,问你最后能不能将每个点都划分在若干个有向环里(每个点最后只能属于一个环). 题解 这题一开始思路就跑偏了,想到连通分量去了..orz 后来仔细一想,这不是边的分配问题吗!!!首先入度和出度可以分开考虑的,我们只需要考虑每个点的出度就行了,如果一个点的出度只有1,那就显然只能连它了,但是如果它有多个出边…
There will be several test cases in the input. Each test case will begin with a line with three integers: N A B Where N is the number of teams (1N1, 000), and A and B are the number of balloons in rooms A and B, respectively (0A, B10, 000). On each o…