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

Sudoku

Unrated 레이팅 미적용
난이도
1s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Daily sudoku, New York Times,
November 1, 2023, Difficulty: Hard
Sudoku is a log\(ic-ba\)sed, combinatorial numb\(er-pl\)acement puzzle.
The objective is to fill a \(9 \times 9\) grid with digits from 1 to 9 in such
a way that the following statements hold:
• Each row contains exactly one occurrence of each digit
from 1 to 9.
• Each column contains exactly one occurrence of each digit
from 1 to 9.
• Each of the nine \(3 \times 3\) subgrids contains exactly one occur-
rence of each digit from 1 to 9.
For a given not yet finished sudoku grid, determine if there is
a mistake in it.
Note: It is not necessary to check whether the sudoku grid is
solvable.

제약

Subtask 1 (11 points): It’s possible to determine whether there is a mistake by only checking the first rule.

Subtask 2 (12 points): It’s possible to determine whether there is a mistake by only checking the second rule.

Subtask 3 (13 points): It’s possible to determine whether there is a mistake by only checking the third rule.

Subtask 4 (14 points): No additional constraints.

입력 형식

The input describes the sudoku grid.
The characters ’|’, ’-’ and ’+’ frame the \(3 \times 3\) subgrids.
The character ’.’ represents an empty cell.
All the other characters in the input will be digits from ’1’ to ’9’.
See the examples for clarification.

출력 형식

Output the word GRESKA if there is a mistake in the sudoku board. Otherwise, output the word OK.

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

1

11점

It’s possible to determine whether there is a mistake by only checking the first rule.

2

12점

It’s possible to determine whether there is a mistake by only checking the second rule.

3

13점

It’s possible to determine whether there is a mistake by only checking the third rule.

4

14점

No additional constraints.

예제 1
입력
+---+---+---+
|52.|...|.81|
|.39|58.|...|
|.8.|.9.|...|
+---+---+---+
|24.|...|1.3|
|1..|43.|86.|
|.63|..7|.24|
+---+---+---+
|...|1.9|35.|
|..8|.74|6..|
|31.|86.|7.9|
+---+---+---+
출력
OK
예제 2
입력
+---+---+---+
|3..|6..|..4|
|4.9|8.1|..7|
|..7|.49|6..|
+---+---+---+
|946|157|8.2|
|.2.|3..|745|
|.7.|28.|...|
+---+---+---+
|...|4..|..5|
|8.5|.6.|.2.|
|734|..8|5..|
+---+---+---+
출력
GRESKA
예제 3
입력
+---+---+---+
|5..|98.|67.|
|6..|...|.31|
|.2.|613|.4.|
+---+---+---+
|.96|8.2|1.7|
|.28|..5|.9.|
|7.3|19.|6..|
+---+---+---+
|962|.7.|.1.|
|1.5|...|76.|
|.7.|5..|9..|
+---+---+---+
출력
GRESKA
설명

Clarification of the first example:
There is no mistake, so the output is OK.
Clarification of the second example:
There is a mistake in the ninth column: the digit 5 appears twice; and there is also a mistake in the lower
right 3 × 3 subgrid: the digit 5 appears twice.
Clarification of the third example:
There are two mistakes: the digit 2 appears twice in the second column, and the digit 6 appears twice in
the seventh column.

문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2023/2024 Contest 1

평가 및 의견

Sudoku

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Sudoku

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