Logo
(追記) (追記ここまで)

21159번 - Simply Sudoku 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB28181669.565%

문제

Sudoku puzzles come in all different shapes and difficulty levels. Traditionally a Sudoku puzzle is a 9ドル\times9$ grid. Initially, some of the cells are filled in with numbers and some are empty. The goal is to fill in each cell with a number in the range 1ドル$ -- 9ドル$ subject to the following restrictions:

  • Each digit 1ドル$ -- 9ドル$ must appear once in each row
  • Each digit 1ドル$ -- 9ドル$ must appear once in each column
  • Each digit 1ドル$ -- 9ドル$ must appear once in each 3ドル\times3$ sub-grid

The difficulty of a Sudoku puzzle can vary widely. The easiest puzzles can be solved with the following two simple techniques:

  • Single Value Rule: search for squares which only have one possible value that can be put there.
  • Unique Location Rule: within any row, column or sub-grid search for a value that can only be placed in one of the nine locations.

Consider the partially solved Sudoku puzzle shown in Figure 1. The Single Value Rule applies to grid square A7ドル$ where 8ドル$ is the only value that can be placed there. The Unique Location Rule can be used to put a 5ドル$ in square B3ドル$ as it is the only location in row 3ドル$ where a 5ドル$ can be placed.

Figure 1: Sample Input 1ドル$

The easiest Sudoku puzzles can be solved with only these two rules; harder puzzles use techniques like swordfish, x-wings and BUGs.

For this problem you will be given a Sudoku puzzle and must determine if it is an easy puzzle, i.e., whether it can be solved by just using the Single Value and Unique Location rules.

입력

Input consists of a single Sudoku puzzle given over nine lines. Each line contains 9ドル$ values in the range 0ドル$ to 9ドル,ドル where a 0ドル$ indicates a blank in the puzzle.

출력

Output the word Easy followed by the solved Sudoku puzzle if it is an easy puzzle. The puzzle should be printed on nine lines with a single space separating values on a line. If the puzzle is not easy output Not easy followed by as much of the Sudoku puzzle as can be solved using the two rules described above. Use the same format for the partial solution as for the complete solution using a '.' instead of a digit for a unfilled square.

제한

예제 입력 1

2 6 0 5 1 0 3 0 0
3 0 0 0 6 0 0 0 2
0 1 5 0 7 3 9 0 4
0 0 9 0 0 0 5 0 0
0 0 2 6 0 1 4 0 0
0 0 6 0 0 0 7 0 0
6 0 1 9 4 0 2 3 0
9 0 0 0 2 0 0 0 5
0 0 8 0 3 5 0 4 9

예제 출력 1

Easy
2 6 4 5 1 9 3 7 8
3 9 7 8 6 4 1 5 2
8 1 5 2 7 3 9 6 4
1 3 9 4 8 7 5 2 6
5 7 2 6 9 1 4 8 3
4 8 6 3 5 2 7 9 1
6 5 1 9 4 8 2 3 7
9 4 3 7 2 6 8 1 5
7 2 8 1 3 5 6 4 9

예제 입력 2

0 0 0 0 0 0 7 0 1
0 0 0 0 0 1 2 3 5
0 0 1 8 0 0 0 0 6
0 0 0 0 2 5 0 9 3
9 0 0 0 0 0 0 0 2
3 1 0 6 7 0 0 0 0
2 0 0 0 0 3 8 0 0
1 3 8 9 0 0 0 0 0
4 0 6 0 0 0 0 0 0

예제 출력 2

Not easy
. . 3 . . . 7 8 1
. . . . . 1 2 3 5
. . 1 8 3 . 9 4 6
. . . . 2 5 . 9 3
9 . . 3 . . . 7 2
3 1 2 6 7 9 4 5 8
2 . . . . 3 8 . .
1 3 8 9 . . 5 . .
4 . 6 . . . 3 . .

힌트

출처

ICPC > Regionals > North America > East Central North America Regional > 2020 East Central Regional Contest J번

  • 문제를 만든 사람: Bob Roos
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /