Description Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently labeled 0…N-1)
P1204 [USACO1.2]挤牛奶Milking Cows 题目链接:P1204 [USACO1.2]挤牛奶Milking Cows 题意:给定 n n n 个区间,求这些区间覆盖后最长的区间和未被覆盖的最长区间(未被覆盖区间的范围在最左端到最右端内,否则就没有意义了) 正如简化的题意,我们可以使用类似于差分的思想,如图 我们可以保存左右端点,然后从左向右遍历(排序一下就行