博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Codeforces 1335D. Anti-Sudoku(思维)
阅读量:739 次
发布时间:2019-03-21

本文共 524 字,大约阅读时间需要 1 分钟。

一、传送门

二、算法分析说明

把所有的 1 (或其他数字)换成另外的数字,就满足每行、每列、每块变更的数字的位置都不同。

三、AC 代码

#include
#pragma warning(disable: 4996)typedef unsigned char uchar; typedef unsigned short ushort; typedef unsigned int uint;typedef long long ll; typedef unsigned long long ull;using namespace std;char s[10];int main() {
ios::sync_with_stdio(false); cin.tie(0); uint t; cin >> t; ++t; while (--t) {
for (uint i = 0; i < 9; ++i) {
cin >> s; for (uint j = 0; j < 9; ++j)if (s[j] == '1')s[j] = '2'; cout << s << '\n'; } } return 0;}

转载地址:http://zrtez.baihongyu.com/

你可能感兴趣的文章