No.3593 I Love Sudoku
タグ : / 解いたユーザー数 6
作問者 :
Problem Statement
A $9 \times 9$ matrix whose elements are integers between $0$ and $8$, inclusive, is called a "Sudoku matrix" if it satisfies all of the following $3$ conditions.
- In each row, each integer from $0$ to $8$ appears exactly $1$ time.
- In each column, each integer from $0$ to $8$ appears exactly $1$ time.
- When the matrix is divided into $3 \times 3$ blocks, each integer from $0$ to $8$ appears exactly $1$ time in each block.
Now, consider $2$ Sudoku matrices $A, B$. Compute the matrix product $C = AB$ of these $2$ matrices, and let $C'$ be the matrix obtained by replacing each element of $C$ with its remainder when divided by $9$.
Your goal is to find and output $1$ pair of 2 Sudoku matrices $A, B$ such that $C'$ is also a Sudoku matrix.
※ This problem is Output-only. No input is given.
Input
(No input is given)
Output
Output the elements of matrix $A$ in the first $9$ lines, and the elements of matrix $B$ in the following $9$ lines. Each line should contain $9$ integers separated by spaces. (You will output $18$ lines in total.)
$A_{1,1}$ $A_{1,2}$ $\dots$ $A_{1,9}$
$\vdots$
$A_{9,1}$ $A_{9,2}$ $\dots$ $A_{9,9}$
$B_{1,1}$ $B_{1,2}$ $\dots$ $B_{1,9}$
$\vdots$
$B_{9,1}$ $B_{9,2}$ $\dots$ $B_{9,9}$
Constraints
- The output matrices $A, B$ must both be $9 \times 9$ Sudoku matrices.
- Each element of the output matrices $A, B$ must be an integer between $0$ and $8$, inclusive.
- It is guaranteed that a pair $(A, B)$ satisfying the conditions exists. If there are multiple such pairs, any of them will be accepted.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。