QOJ.ac

QOJ

시간 제한: 2.0 s 메모리 제한: 256 MB 총점: 100 해킹 가능 ✓

#14121. 距离字符串

통계

Vasya 想要构造 $n$ 个长度相等且仅包含前 $k$ 个小写拉丁字母的字符串。他定义两个字符串的相似度为它们在相同位置上字符相同的个数。Vasya 希望任意两个字符串之间的相似度都相同,且该相似度不能超过 $2m/(k + 2)$,其中 $m$ 是字符串的长度。他同时不希望字符串太长,更具体地说,字符串的长度不应超过 $2n$。

输入格式

输入的唯一一行包含两个整数 $n$ 和 $k$($2 \le n \le 1000$;$2 \le k \le 26$)。

输出格式

第一行输出两个整数 $m$ 和 $l$ —— 字符串的长度以及任意两个字符串之间的相似度。

接下来的 $n$ 行输出这些字符串。字符串应由小写拉丁字母组成。

样例

输入样例 1

4 2

输出样例 1

3 1
aaa
bba
abb
bab

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.