問題一覧 > 通常問題

No.1971 Easy Sudoku

レベル : / AI推定難易度 : 133 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 223
作問者 : magsta / テスター : harurun
お気に入りにしたユーザー ProblemId : 6841 / 自分の提出
問題文最終更新日: 2022-06-06 21:59:10
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 347 (順位表) の他の問題:

Problem Statement

Construct a matrix that satisfies all of the following conditions.

  • It has $N$ rows and $N$ columns.
  • In each row, every integer between $1$ and $N$, inclusive, appears exactly 1 time.
  • In each column, every integer between $1$ and $N$, inclusive, appears exactly 1 time.

Constraints

  • $\displaystyle 1 \leq N \leq 100$
  • All inputs are integers.

Input

The input is given from standard input in the following format.

$N$

Output

Output the answer in the following format, followed by a newline at the end.

If there are multiple possible answers, you may output any of them.

$A_{i,j}$ denotes the element in row $i$, column $j$ of the constructed matrix.

$A_{1,1}\ \ A_{1,2} \ \dots \ A_{1,N}$
$A_{2,1}\ \ A_{2,2} \ \dots \ A_{2,N}$
$:$
$A_{N,1}\ \ A_{N,2} \ \dots \ A_{N,N}$

Sample

Sample 1
Input
4
Output
4 2 3 1
2 4 1 3
1 3 4 2
3 1 2 4

Any other output is also acceptable as long as it satisfies the conditions.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。