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。可以用两个单调队列,一个单增维护最小值,一个单减维护最大值

posted @ 2018-04-14 00:04  蒟蒻LQL  阅读(116)  评论(0编辑  收藏  举报