問題一覧 > 通常問題

No.3593 I Love Sudoku

レベル : / AI推定難易度 : 1800 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 6
作問者 : trqs
お気に入りにしたユーザー ProblemId : 13319 / 自分の提出
問題文最終更新日: 2026-04-28 08:07:36
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 505 (順位表) の他の問題:

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.

  1. In each row, each integer from $0$ to $8$ appears exactly $1$ time.
  2. In each column, each integer from $0$ to $8$ appears exactly $1$ time.
  3. 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もしくは右上の雲マークをクリックしてアカウントを作成してください。