RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00087

Cross

Gold II 골드 II
난이도
1s
시간 제한
32MB
메모리 제한
1
맞았습니다!!
1
제출 수
100.0%
정답률
레이팅

의견: 0

설명

In the game of Sudoku, the objective is to place integers between \(1\) and \(9\) (inclusive) into a \(9 \times 9\) grid so that each row, each column, and each of the nine \(3 \times 3\) boxes contains all nine numbers. The starting board is partially filled in so that it is possible to logically deduce the values of the other cells. Sudoku puzzles range in difficulty, and complex analysis methods are required to solve the hardest puzzles. In this problem, however, you will implement one of the simplest methods, cross-hatching.

In cross-hatching, we select one of the nine numbers and, for each of its occurrences in the grid, cross out the corresponding row, column and \(3 \times 3\) box. Now look for any \(3 \times 3\) boxes where there is only one possible placement for the number and place it there.

You will be given a partially filled-in grid. Your task is to repeatedly apply the cross-hatching method for different numbers until no more deductions can be made about any number.

The initial placement of the numbers in the grid may be invalid. It is also possible that there will be no available cell for a number in a \(3 \times 3\) box. In both cases, you are to report an error.

제약
입력 형식

Input will consist of \(9\) lines, each containing exactly \(9\) characters. Each character will either be a digit between \(1\) and \(9\), or a period (.) denoting an empty cell.

출력 형식

If the input is valid and there is no contradiction while solving, you should output the grid in the same
format it was given in, with cells filled in if their value can be deduced using cro\(ss-ha\)tching. Otherwise,
output "ERROR" (quotes for clarity).
Contest #3, \(13^{th}\) December 2008

서브태스크
서브태스크점수설명

Subtask 1

70점
예제 1
입력
..9......
.....4...
.......4.
.........
.4.......
.........
.........
.........
.........
출력
4.9......
.....4...
.......4.
.........
.4.......
.........
.........
.........
.........
예제 2
입력
...1...6.
18...9...
..7.642..
2.9..6.5.
.43...72.
.6.3..9.1
..265.1..
...2...97
.5...3...
출력
524137869
186529473
397864215
219476358
843915726
765382941
972658134
638241597
451793682
예제 3
입력
1........
..1......
.......1.
.........
.........
.........
.........
.........
.........
출력
ERROR
예제 4
입력
........2
....1....
1........
......1..
.........
.........
.........
.......1.
.........
출력
ERROR
문제 정보

riseoj 작성

출처 COCI 2008/2009 Contest 3

평가 및 의견

Cross

개요
출제자 난이도 Gold II 골드 II 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Cross

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8