Sudoku 2

Luogu
IDLGP10482
Time1000ms
Memory512MB
DifficultyP5
剪枝Dancing Links
In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, ![](https://cdn.luogu.com.cn/upload/image_hosting/acjiq3ud.png) Given some of the numbers in the grid, your goal is to determine the remaining numbers such that the numbers 1 through 9 appear exactly once in (1) each of nine 3 × 3 subgrids, (2) each of the nine rows, and (3) each of the nine columns. ## Input The input test file will contain multiple cases. Each test case consists of a single line containing 81 characters, which represent the 81 squares of the Sudoku grid, given one row at a time. Each character is either a digit (from 1 to 9) or a period (used to indicate an unfilled square). You may assume that each puzzle in the input will have exactly one solution. The end-of-file is denoted by a single line containing the word “end”. ## Output For each test case, print a line representing the completed Sudoku puzzle. [samples]
Samples
Input #1
.2738..1..1...6735.......293.5692.8...........6.1745.364.......9518...7..8..6534.
......52..8.4......3...9...5.1...6..2..7........3.....6...1..........7.4.......3.
end
Output #1
527389416819426735436751829375692184194538267268174593643217958951843672782965341
416837529982465371735129468571298643293746185864351297647913852359682714128574936
API Response (JSON)
{
  "problem": {
    "name": "Sudoku 2",
    "description": {
      "content": "In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example, ![](https://cdn.luogu.com.cn/upload/image_hosting/acjiq3ud.png) Given some of the numbers in",
      "description_type": "Markdown"
    },
    "platform": "Luogu",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 524288
    },
    "difficulty": {
      "LuoguStyle": "P5"
    },
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "LGP10482"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For example,\n\n![](https://cdn.luogu.com.cn/upload/image_hosting/acjiq3ud.png)\n\nGiven some of the numbers in...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments