#P12412. 「YLLOI-R1-T1」等你下课
「YLLOI-R1-T1」等你下课
Description
The OI training camp is coming, but Little Y's classmates still want to attend school.
There are available classes. Little Y has good friends, and the -th friend plans to attend of these classes. Since Little Y considers himself too strong, he doesn't attend any classes.
If all of Little Y's friends attend the same class, he will be alone in the computer room during that class and feel lonely. His friends want to rearrange their class selections to minimize the number of such lonely classes.
Determine the minimum number of lonely classes for Little Y, after optimally rearranging his friends' class choices.
Input Format
The first line contains two integers, and .
The second line contains integers, the -th is .
Output Format
Output a single integer — the minimum number of classes during which Little Y will be alone.
2 3
3 2
2
3 4
3 3 3
1
6 5
1 1 4 5 1 4
0
Hint
Explanation
Sample 1:
Friend 1 has to attend all classes, so every class he attends is fixed. If friend 2 attends any class, that class will be attended by both friends, and thus Little Y will be alone during all those classes. So the minimum number of lonely classes is .
Sample 2:
One possible valid arrangement:
| Class 1 | Class 2 | Class 3 | Class 4 | |
|---|---|---|---|---|
| Friend 1 | ✓ | ✓ | ✓ | |
| Friend 2 | ✓ | |||
| Friend 3 | ✓ |
Only Class 2 is attended by all three friends, so Little Y is lonely in just that one class.
Constraints
This problem uses subtask scoring.
- Subtask 1 (20 pts): .
- Subtask 2 (20 pts): .
- Subtask 3 (30 pts): .
- Subtask 4 (30 pts): No additional constraints.
For all data:
- .
- .
- .
京公网安备 11011102002149号