当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2676:Sudoku

Special Judge 特殊评判
题目描述
Sudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written decimal digits from 1 to 9. The other cells are empty. The goal is to fill the empty cells with decimal digits from 1 to 9, one digit per cell, in such way that in each row, in each column and in each marked 3x3 subsquare, all the digits from 1 to 9 to appear. Write a program to solve a given Sudoku-task.
输入解释
The input data will start with the number of the test cases. For each test case, 9 lines follow, corresponding to the rows of the table. On each line a string of exactly 9 decimal digits is given, corresponding to the cells in this line. If a cell is empty it is represented by 0.
输出解释
For each test case your program should print the solution in the same format as the input data. The empty cells have to be filled according to the rules. If solutions is not unique, then the program may print any one of them.
输入样例
1
103000509
002109400
000704000
300502006
060000050
700803004
000401000
009205800
804000107
输出样例
143628579
572139468
986754231
391542786
468917352
725863914
237481695
619275843
854396127

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2676

最后修改于 2020-10-29T06:39:02+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 65536