시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 512 MB | 43 | 24 | 18 | 66.667% |
This is an output-only problem.
Your task is to build a square grid with side length $N \ge 13$ and fill it with lowercase English letters such that the following property is held.
Let us denote the character at $i$-th row and $j$-th column as $c_{i,j}$.
Consider $N^2 \cdot (N-1) / 2$ strings of the form $A_{i,j,p} = c_{i,j} c_{i,j+1} \ldots c_{i,j+p}$ for every $1 \le i \le N$ and every $1 \le j, p \le N-1$ such that $j + p \le N$.
Consider also $N^2 \cdot (N-1) / 2$ strings of the form $B_{i,j,p} = c_{i,j} c_{i+1,j} \ldots c_{i+p,j}$ for every $1 \le j \le N$ and every $1 \le i, p \le N-1$ such that $i + p \le N$.
All those $N^2 \cdot (N-1)$ strings have to be pairwise distinct.
There is no input.
Print the answer in the following format: first print the $N$ ($13 \le N \le 100$). Then print the square grid as $N$ lines; $i$-th line shall contain one string of $N$ characters, representing the $i$-th row of the grid.
If there are several correct solutions, any one of them will be accepted.
4 petr ozav odsk camp
For the answer from the sample, the grid property is held, but the grid size is too small to be accepted as a solution.