Subsequence

TimeLimit:1000MS  MemoryLimit:32768KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏 | 已有3人收藏了本题
Problem Description

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.

注意这题题目描述不严谨,准确来说不是子序列,应该是子区间

Input
There are multiple test cases.
For each test case, the first line has three integers, n, m and k. n is the length of the sequence and is in the range [1, 100000]. m and k are in the range [0, 1000000]. The second line has n integers, which are all in the range [0, 1000000].
Proceed to the end of file.
Output
For each test case, print the length of the subsequence on a single line.
SampleInput
5 0 0
1 1 1 1 1
5 0 3
1 2 3 4 5
SampleOutput
5
4
Submit
题目统计信息详细
总AC数79
通过人数52
尝试人数59
总提交量166
AC率31.33%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: