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

建议使用的浏览器:

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

6341:Problem J. Let Sudoku Rotate

题目描述
Sudoku is a logic-based, combinatorial number-placement puzzle, which is popular around the world.
In this problem, let us focus on puzzles with $16 \times 16$ grids, which consist of $4 \times 4$ regions. The objective is to fill the whole grid with hexadecimal digits, i.e. 0123456789ABCDEF, so that each column, each row, and each region contains all hexadecimal digits. The figure below shows a solved sudoku.



Yesterday, Kazari solved a sudoku and left it on the desk. However, Minato played a joke with her - he performed the following operation several times.
* Choose a region and rotate it by 90 degrees counterclockwise.
She burst into tears as soon as she found the sudoku was broken because of rotations.
Could you let her know how many operations her brother performed at least?
输入解释
The first line of the input contains an integer $T$ $(1 \le T \le 10 ^ 3)$ denoting the number of test cases.
Each test case consists of exactly $16$ lines with $16$ characters each, describing a broken sudoku.
输出解释
For each test case, print a non-negative integer indicating the minimum possible number of operations.
输入样例
1
681D5A0C9FDBB2F7
0A734B62E167D9E5
5C9B73EF3C208410
F24ED18948A5CA63 
39FAED5616400B74 
D120C4B7CA3DEF38 
7EC829A085BE6D51 
B56438F129F79C2A 
5C7FBC4E3D08719F 
AE8B1673BF42A58D 
60D3AF25619C30BE
294190D8EA57264C 
C7D1B35606835EAB 
AF52A1E019BE4306 
8B36DC78D425F7C9 
E409492FC7FA18D2
输出样例
5

提示
The original sudoku is same as the example in the statement.
来自杭电HDUOJ的附加信息
Recommend chendu

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

源链接: HDU-6341

最后修改于 2020-10-25T23:30:26+00:00 由爬虫自动更新

共提交 0

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