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

建议使用的浏览器:

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

3973:Highlights

题目描述
The soccer league ends today and you as director of a sports program at a well known sports channel are working on the season’s highlights.

Your team did a great job interviewing each of the N players who participated in the league matches, additionally you have M game-plays (corner kicks, goals ... etc).

You've a limited quota of time allocated to show your highlights tape on the sports news program and you want to make the best use of this time, Your media quality advisor told you that the most efficient way to cover the season’s activities is to compile a highlights tape such that no player’s interview is included in the highlights if he participated in a game-play that is also included in the highlights.

To realize the advisor recommendations you've decided to use your old computer science skills and write down a program that calculates H the maximum number of highlights than can be put on a tape together while following the advisor's recommendation above.
输入解释
The first line of input contains T <= 50 the number of test cases, T test cases follow. Each test case starts with a line containing N (1 <= N <= 100) and M (0 <= M <= 100) the total number of players and the number of available game–plays respectively. M lines follow, each line describes a single game play and starts with an integer P (1 <= P <= N) the number of participating players followed by P space separated integers representing the players numbers. Players are number from 1 to N.
输出解释
For each test case print "Case t: " where t is the test case number starting from 1, followed by H described above.
输入样例
2
2 2
1 1
2 1 2
3 1
3 1 2 3
输出样例
Case 1: 2
Case 2: 3

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3973

最后修改于 2020-10-29T07:17:04+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000 65536