#x1061. CF976F Minimal k-covering
CF976F Minimal k-covering
Minimal k-covering
题面翻译
题目大意
给你一张二分图 , 是图的 部, 是图的 部, 是边集,可能有重边。
我们称 的某个子集 是 k-覆盖 的,当且仅当图 的每个顶点至少连接了 条边;若 是 k-覆盖 的且不存在元素个数比它更小的边集也是 k-覆盖 的,则称 是一个 最小k-覆盖 。
你的任务是对于所有 ,求出 最小k-覆盖,其中 是图 的所有点度数的最小值。
输入格式
第一行输入三个整数 , 和 ( , ),分别代表 的点数, 的点数和边数。
接下来 行每行两个整数 和 ,表示第 条边在 中的端点为 ,在 中的端点为 。
输出格式
输出包含 行,每行首先输出一个整数 ,表示 最小k-覆盖 的边集大小,紧接着输出 个整数,表示属于 最小k-覆盖 的边的标号。边按输入顺序从 开始标号。输出时不必按标号从小到大输出。
感谢@OrangeLee 提供的翻译
题目描述
You are given a bipartite graph , is the set of vertices of the first part, is the set of vertices of the second part and is the set of edges. There might be multiple edges.
Let's call some subset of its edges -covering iff the graph
has each of its vertices incident to at least edges. Minimal -covering is such a -covering that the size of the subset
is minimal possible.
Your task is to find minimal -covering for each , where is the minimal degree of any vertex in graph .
输入格式
The first line contains three integers , and ( , ) — the number of vertices in the first part, the number of vertices in the second part and the number of edges, respectively.
The -th of the next lines contain two integers and ( ) — the description of the -th edge, is the index of the vertex in the first part and is the index of the vertex in the second part.
输出格式
For each print the subset of edges (minimal -covering) in separate line.
The first integer of the -th line is the number of edges in minimal -covering of the graph. Then integers follow — original indices of the edges which belong to the minimal -covering, these indices should be pairwise distinct. Edges are numbered through in order they are given in the input.
样例 #1
样例输入 #1
3 3 7
1 2
2 3
1 3
3 2
3 3
2 1
2 1
样例输出 #1
0
3 3 7 4
6 1 3 6 7 4 5
样例 #2
样例输入 #2
1 1 5
1 1
1 1
1 1
1 1
1 1
样例输出 #2
0
1 5
2 4 5
3 3 4 5
4 2 3 4 5
5 1 2 3 4 5
相关
在下列比赛中: