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

建议使用的浏览器:

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

6852:Increasing and Decreasing

题目描述
Notice:Don't output extra spaces at the end of one line.

Given $n, x, y$, please construct a permutation of length $n$, satisfying that:

- The length of LIS(Longest Increasing Subsequence) is equal to $x$.
- The length of LDS(Longest Decreasing Subsequence) is equal to $y$.

If there are multiple possible permutations satisfying all the conditions, print the lexicographically minimum one.
输入解释
The first line contains an integer $T(1 \leq T \leq 100)$, indicating the number of test cases.

Each test case contains one line, which contains three integers $n, x, y(1 \leq n \leq 10^5, 1 \leq x, y \leq n)$.
输出解释
For each test case, the first line contains ``YES'' or ``NO'', indicating if the answer exists. If the answer exists, output another line which contains $n$ integers, indicating the permutation.
输入样例
4
10 1 10
10 10 1
10 5 5
10 8 8
输出样例
YES
10 9 8 7 6 5 4 3 2 1
YES
1 2 3 4 5 6 7 8 9 10
YES
1 2 3 5 4 10 9 8 7 6
NO
来自杭电HDUOJ的附加信息
Recommend IceyWang

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

源链接: HDU-6852

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

共提交 0

通过率 --%
时间上限 内存上限
3000/3000MS(Java/Others) 524288/524288K(Java/Others)