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

34444번 - Sudoku Verify 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB36312686.667%

문제

A Sudoku puzzle is a number puzzle that is played on a 9ドル \times 9$ grid of cells. These cells are grouped into nine (9ドル$) non-overlapping 3ドル \times 3$ regions, for a total of nine (9ドル$) cells per region. The regions are shown outlined in bold on the figure on the right.

The initial state of the grid has some of the cells filled in (black in the figure on the right). The objective is to use logical inferences to fill in the rest of the board. But there are rules for how to fill out the remainder of the board. The rules are as follows:

  • Along every column, every number between 1ドル$ and 9ドル$ (inclusive) must appear exactly once.
  • Along every row, every number between 1ドル$ and 9ドル$ (inclusive) must appear exactly once.
  • In each 3ドル \times 3$ region, every number between 1ドル$ and 9ドル$ (inclusive) must appear exactly once.

You are given a completed Sudoku puzzle. Determine whether it is valid.

입력

Each row of the filled out Sudoku puzzle corresponds to one line of input. The numbers of each row are separated by a single space. This encoding leads to an input with exactly nine (9ドル$) lines each of which contains exactly nine (9ドル$) numbers between 1ドル$ and 9ドル$ inclusive.

출력

If the Sudoku board is valid, output the text "VALID" (without the quotes).

If the Sudoku board is not valid, output the text "INVALID!" (without the quotes).

제한

예제 입력 1

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

예제 출력 1

VALID

예제 입력 2

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

예제 출력 2

INVALID!

노트

출처

School > CS@Mines > CS@Mines HSPC 2019 I번

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

출처

대학교 대회

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

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