编程介的小学生 2019-11-16 22:35 采纳率: 20.5%
浏览 63

Selecting Problems 思路和做法

Problem Description
The college of computer & software is going to hold an ACM contest. N (0<N<=1000) students have registered for the contest, and the teacher LCY has thought up M (0<M<=15) problems numbered from 1 to M. LCY is so familiar with the students that he can forecast the result of every student for the M problems.
Now he will select as many problems as possible from the M problems. And he want at least K (0<=K<=M) students to solve all problems. Will you compute the maximum number of problems he can choose? Output "0" if there is no selection can satisfy the condition.

Input
First line of each case contains three integers: N, M and K. Then N lines follow, and each line has the format:
Name P N1 N2 … NP.
Name (the length won't exceed 20), P (number of problems he/she can solve, 0<=P<=M), then P integers (represent the problems, 1-based).

Output
Output the maximum number of problems.

Sample Input
2 6 2
zl1 6 1 2 3 4 5 6
zl2 5 1 2 3 4 5
2 3 2
zl1 2 2 3
zl2 1 1

Sample Output
5
0

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 素材场景中光线烘焙后灯光失效
    • ¥15 请教一下各位,为什么我这个没有实现模拟点击
    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器