QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 256 MB Points totaux : 100 Difficulté: [afficher] Hackable ✓
Statistiques

给你一个长度为 $n$ 的排列 $a$。同时给你正整数 $k$ 和 $m$ ($1 \le k \le m \le n$)。

你需要判断是否存在一个 $a$ 的长度为 $m$ 的子序列 $b$,满足 $b$ 的最长上升子序列的长度等于 $k$。如果存在这样的子序列,你需要输出其中任意一个。

输入格式

第一行包含三个整数 $n, m, k$ ($1 \le k \le m \le n \le 5\,000$) —— 排列的长度、子序列 $b$ 的长度,以及 $b$ 的最长上升子序列的长度。

输出格式

第一行输出 “Yes” 或 “No”。评测时忽略大小写。

如果存在这样的子序列,在第二行输出满足条件的子序列之一。

样例

输入样例 1

5 2 2
4 5 3 2 1

输出样例 1

Yes
4 5

输入样例 2

5 2 2
5 4 3 2 1

输出样例 2

No

输入样例 3

6 4 2
1 3 4 2 6 5

输出样例 3

Yes
4 2 6 5

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#373EditorialOpen题解jiangly2025-12-14 07:27:55View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.