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

30649번 - Sudoku 서브태스크다국어

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

문제

Sudoku is a logic-based, combinatorial number-placement puzzle. The objective is to fill a 9 × 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 × 3 subgrids contains exactly one occurrence 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.

입력

The input describes the sudoku grid.

The characters ’|’, ’-’ and ’+’ frame the 3 × 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.

제한

서브태스크

번호배점제한
111

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

212

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

313

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

414

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|
+---+---+---+

예제 출력 1

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..|
+---+---+---+

예제 출력 2

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..|
+---+---+---+

예제 출력 3

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.

출처

Contest > Croatian Open Competition in Informatics > COCI 2023/2024 > Contest #1 1번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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