Sudoku (2)

This exercise has the same wording than the exercise P89454: Write a
program that finds all the possible solutions of a sudoku.

Input

Input consists of 81 numbers between zero and nine, plus the bars and
dashes that can be seen at the instances. The zeros indicate positions
of unknown value. Except zeros, there will not be any repeated number in
any row, nor any column, nor any of the nine squares 3 × 3.

Output

Your program must print all the possible solutions of the given sudoku,
each one with a line in white in the end. It must print "-1" if there is
not any possible solution.

Observations

- A backtracking that simply fulls the rows from top to bottom and from
  left to right will not be fast enough to solve this exercise.

- Information about the checker

  You can print the solutions to this exercise in any order.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-02-04T17:25:32.171Z

© Jutge.org, 2006–2026.
https://jutge.org
