QOJ.ac

QOJ

時間限制: 1 s 記憶體限制: 512 MB 總分: 100 难度: [顯示]

#1806. 字符网格

统计

这是一个只读输出问题。

你的任务是构建一个边长为 $N \ge 13$ 的方格网,并用小写英文字母填充它,使得以下性质成立。

令 $c_{i,j}$ 表示第 $i$ 行第 $j$ 列的字符。

考虑 $N^2 \cdot (N - 1) / 2$ 个形如 $A_{i,j,p} = c_{i,j}c_{i,j+1} \dots c_{i,j+p}$ 的字符串,其中 $1 \le i \le N$ 且对于所有 $1 \le j, p \le N - 1$ 满足 $j + p \le N$。

同时考虑 $N^2 \cdot (N - 1) / 2$ 个形如 $B_{i,j,p} = c_{i,j}c_{i+1,j} \dots c_{i+p,j}$ 的字符串,其中 $1 \le j \le N$ 且对于所有 $1 \le i, p \le N - 1$ 满足 $i + p \le N$。

所有这 $N^2 \cdot (N - 1)$ 个字符串必须两两不同。

按以下格式打印答案:首先打印 $N$ ($13 \le N \le 100$)。然后打印该方格网,共 $N$ 行;第 $i$ 行应包含一个长度为 $N$ 的字符串,表示网格的第 $i$ 行。

如果有多个正确的解,接受其中任意一个即可。

样例

输入格式 1

(无)

输出格式 1

4
petr
ozav
odsk
camp

说明

对于样例中的答案,网格性质成立,但网格尺寸太小,不符合题目要求的解。

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.