Type: Default 1000ms 512MiB

序列

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

T1:

限制

  • 1000 ms
  • 524288 KB

文件

seq


小王有 11nnnn 个整数,小杨想让小王把这 nn 个整数排成一行使其满足一定的条件:

11. 最长上升子序列的长度为 xx

22. 最长下降子序列的长度为 yy

如果有多个满足要求的排列,输出字典序最小的一个。

输入格式

输入第一行为三个整数 n,x,yn,x,y,含义如题目所述。

输出格式

第一行为 "YES" 或 "NO"(不含引号),表示答案是否存在。若答案存在,在第二行输出这个序列。


样例输入 1

10 1 10

样例输出 1

YES
10 9 8 7 6 5 4 3 2 1

样例输入 2

10 6 4

样例输出 2

YES
1 2 3 4 6 5 10 9 8 7

数据范围

对于 50%50\% 的数据,n10n\leq 10

对于 100%100\% 的数据,n100000n\leq 1000001x,yn1\leq x,y\leq n

CSP-J2024模拟5

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2024-8-5 11:00
End at
2024-8-5 15:00
Duration
4 hour(s)
Host
Partic.
13