Блог пользователя border

Автор border, история, 6 лет назад, По-английски

Problem Link: Sudoku Solver

My code: link

Pretty straightforward problem. I tried sorting the blank points on the basis of options for a point. I also tried with simple backtracking. In both cases I got TLE.

What am I missing here?

Also, is there any way to use bits to mask which number is possible for a place(row/column/box)?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 лет назад, # |
Rev. 3   Проголосовать: нравится +2 Проголосовать: не нравится

You may check this recursive solution with backtracking for the standard 9x9 Sudoku.

The solution uses Raster scan to traverse the Sudoku board, and stops when all cells have numbers that are consistent with the Sudoku rules.