当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6006:Engineer Assignment

题目描述
In Google, there are many experts of different areas. For example, MapReduce experts, Bigtable experts, SQL experts, etc. Directors need to properly assign experts to various projects in order to make the projects going smoothly.
There are N projects owned by a director. For the $i^{th}$ project, it needs $C_i$ different areas of experts, $a_{i,0}, a_{i,1}, · · · , a_{i,C_i-1}$ respective. There are M engineers reporting to the director. For the $i^{th}$ engineer, he is an expert of $D_i$ different areas, $b_{i,0}, b_{i,1}, ... , b_{i,D_i-1}.$
Each engineer can only be assigned to one project and the director can assign several engineers to a project. A project can only be finished successfully if the engineers expert areas covers the project areas, which means, for each necessary area of the project, there is at least one engineer
masters it.
The director wants to know how many projects can be successfully finished.
输入解释
The first line of the input gives the number of test cases, T. T test cases follow. Each test case starts with a line consisting of 2 integers, N the number of projects and M the number of engineers. Then N lines follow. The $i^{th}$ line containing the information of the $i^{th}$ project starts
with an integer $C_i$ then $C_i$ integers follow, $a_{i,0}, a_{i,1}, ... , a_{i,C_i-1}$ representing the expert areas needed for the $i^{th}$ project. Then another M lines follow. The $i_{th}$ line containing the information of the $i^{th}$ engineer starts with an integer $D_i$ then $D_i$ integers follow, $b_{i,0}, b_{i,1}, ... , b_{i,D_i-1}$ representing the expert areas mastered by $i^{th}$ engineer.
输出解释
For each test case, output one line containing “Case #x: y”, where x is the test case number (starting from 1) and y is the maximum number of projects can be successfully finished.

limits


$\bullet 1 ≤ T ≤ 100.$
$\bullet 1 ≤ N, M ≤ 10.$
$\bullet 1 ≤ C_i ≤ 3.$
$\bullet 1 ≤ D_i ≤ 2.$
$\bullet 1 ≤ a_{i,j} , b_{i,j} ≤ 100.$
输入样例
1
3 4
3 40 77 64
3 10 40 20
3 40 20 77
2 40 77
2 77 64
2 40 10
2 20 77
输出样例
Case #1: 2
提示
For the first test case, there are 3 projects and 4 engineers. One of the optimal solution is to assign the first(40 77) and second engineer(77 64) to project 1, which could cover the necessary areas 40, 77, 64. Assign the third(40 10) and forth(20 77) engineer to project 2, which could cover the necessary areas 10, 40, 20. There are other solutions, but none of them can finish all 3 projects.
So the answer is 2.
来自杭电HDUOJ的附加信息
Recommend jiangzijing2015

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 2016 CCPC-Final

源链接: HDU-6006

最后修改于 2020-10-25T23:27:29+00:00 由爬虫自动更新

共提交 6

通过率 0.0%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)