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

建议使用的浏览器:

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

2780:Su-Su-Sudoku

题目描述
By now, everyone has played Sudoku: you're given a 9-by-9 grid of boxes which you are to fill in with the digits 1 through 9 so that 1) every row has all nine digits, 2) every column has all nine digits, and 3) all nine 3-by-3 subgrids have all nine digits. To start the game you are given a partially completed grid and are asked to fill in the remainder of the boxes. One such puzzle is shown below.



In this problem, you will be given Sudoku grids which you have nearly completed; indeed you've filled in every box except five. You are asked to complete the grid, or determine that it's impossible. (You might have already made an error!)
输入解释
The first line of input will contain a positive integer indicating the number of test cases to follow. Each test case will be a nearly completed Sudoku grid consisting of 9 lines, each containing 9 characters from the set of digits 0 through 9. There will be exactly five 0's in each test case, indicating the five unfilled boxes.
输出解释
Output for each test case should be either

Could not complete this grid.

if it is impossible to complete the grid according to the rules of the game, or the completed grid, in the form given below. (There are no blank spaces in the output.) If there is a way to complete the grid, it will be unique. Separate test cases with a blank line.
输入样例
2 
481253697 
267948105 
539671204 
654389712 
908704563 
173562849 
702136958 
315897426 
896425371 
481253697 
267948105 
539671284 
654289710 
908704562 
173562849 
702136958 
315897426 
896425371
输出样例
481253697 
267948135 
539671284 
654389712 
928714563 
173562849 
742136958 
315897426 
896425371 

Could not complete this grid.
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-2780

最后修改于 2020-10-25T22:56:41+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)