当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5489:Removed Interval

题目描述
Given a sequence of numbers $A=a_1,a_2,…,a_N$, a subsequence $b_1,b_2,…,b_k$ of $A$ is referred as increasing if $b_1<b_2<…<b_k$. LY has just learned how to find the longest increasing subsequence (LIS).
Now that he has to select $L$ consecutive numbers and remove them from $A$ for some mysterious reasons. He can choose arbitrary starting position of the selected interval so that the length of the LIS of the remaining numbers is maximized. Can you help him with this problem?
输入解释
The first line of input contains a number $T$ indicating the number of test cases ($T≤100$).
For each test case, the first line consists of two numbers $N$ and $L$ as described above ($1≤N≤100000,0≤L≤N$). The second line consists of $N$ integers indicating the sequence. The absolute value of the numbers is no greater than $10^9$.
The sum of N over all test cases will not exceed 500000.
输出解释
For each test case, output a single line consisting of “Case #X: Y”. $X$ is the test case number starting from 1. $Y$ is the maximum length of LIS after removing the interval.
输入样例
2
5 2
1 2 3 4 5
5 3
5 4 3 2 1
输出样例
Case #1: 3
Case #2: 1
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5489

最后修改于 2020-10-25T23:23:07+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)