#P1668. [USACO04DEC] Cleaning Shifts S
[USACO04DEC] Cleaning Shifts S
Description
There are time slots in a day. John plans to schedule his cows to be on duty to clean the barn. Each cow has her own available interval and only cows who are free can be scheduled. Moreover, every time slot must have a cow on duty.
What is the minimum number of cows required to cover all time slots? If it is impossible to make a valid schedule, output .
Input Format
The first line: , .
Lines to : , .
Output Format
One line, output the minimum number of cows.
3 10
1 7
3 6
6 10
2
Hint
,,。
:Added a set of hack testdata, see details here. Ruled out wrong solutions with time complexity .
Translated by ChatGPT 5
京公网安备 11011102002149号