如果你的暴力形如:
void fil(ll cnt) {
if (cnt * 2 > n * n) {
return;
}
if (chk()) {
for (ll i = 1; i <= n; ++i) {
for (ll j = 1; j <= n; ++j) {
if (a[i][j]) {
cerr << a[i][j];
} else {
cerr << '.';
}
cerr << ' ';
}
cerr << endl;
}
system("pause");
}
}
把注释框起来的部分放到输出后面,不然搜不出 n=4 的合法解