QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100 Hackeable ✓

#10849. 相似度(困难版)

Estadísticas

简单版本和困难版本是不同的问题。不过,建议先通过简单版本。

许多地名具有相似性。例如,Suzhou 和 Quzhou,它们被认为是相似的,因为它们共享一个公共子串 uzhou。子串是字符串中连续的字符序列。例如,在字符串 abcd 中,bc 是它的一个子串,但 ac 不是。

我们将两个字符串之间的相似度定义为它们的最长公共子串的长度。因此,Suzhou 和 Quzhou 之间的相似度为 5,而 Hangzhou 和 Chengdu 之间的相似度为 2。

你的任务是构造 $n$ 个长度均为 $k$ 的不同字符串,且仅由小写英文字母组成。在这些字符串的所有 $\frac{n(n-1)}{2}$ 对组合中,最大相似度应恰好为 $m$。

输入格式

一行包含三个整数 $n, m, k$ ($2 \le n \le 300, 0 \le m \le 50, 1 \le k \le 100$)。

输出格式

如果没有解,输出 No。

否则,第一行输出 Yes。接下来的 $n$ 行,每行包含一个构造出的字符串。注意,这些字符串必须两两不同。

样例

输入格式 1

2 4 8

输出格式 1

Yes
jiangsuu
xiangtan

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.