编程介的小学生 2019-02-18 22:15 采纳率: 20.5%
浏览 188

请问这个选择优化的算法问题输出序列如何是利用C语言的技术?

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 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度
    • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
    • ¥15 再不同版本的系统上,TCP传输速度不一致
    • ¥15 高德地图点聚合中Marker的位置无法实时更新
    • ¥15 DIFY API Endpoint 问题。
    • ¥20 sub地址DHCP问题
    • ¥15 delta降尺度计算的一些细节,有偿
    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式