QOJ.ac

QOJ

Time Limit: 1.0 s Memory Limit: 256 MB Total points: 100 Difficulty: [show] Hackable ✓

#14435. さらにもう一つの構築問題

Statistics

長さ $n$ の順列 $a$ が与えられます。また、正の整数 $k$ と $m$($1 \le k \le m \le n$)も与えられます。

順列 $a$ の長さ $m$ の部分列 $b$ であって、$b$ の最長増加部分列の長さが $k$ に等しくなるようなものが存在するかどうかを判定してください。そのような部分列が存在する場合は、条件を満たすものを任意に 1 つ出力してください。

入力

1 行目には 3 つの整数 $n, m, k$($1 \le k \le m \le n \le 5\,000$)が与えられます。これらはそれぞれ順列の長さ、部分列 $b$ の長さ、および $b$ の最長増加部分列の長さを表します。

出力

1 行目に “Yes” または “No” を出力してください。ジャッジは大文字と小文字を区別しません。

条件を満たす部分列が存在する場合は、2 行目にそのうちの 1 つを出力してください。

入出力例

入力 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题解jianglyView

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.