hdu3530 Subsequence

题意:
There is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the difference between the maximum element and the minimum element of the subsequence is no smaller than m and no larger than k.

分析:找一个最长的区间满足区间内k>=最大值-最小值>=m。可以用两个单调队列,一个单增维护最小值,一个单减维护最大值

原文地址:https://www.cnblogs.com/LQLlulu/p/8825013.html