思路
1.暴力
我们完全可以打一个暴力。
#include <bits/stdc++.h>
using namespace std;
int a[10][10],ans=-1;
bool h[10][10],s[10][10],g[10][10];
int t[10][10]={
{
},{
0,6,6,6,6,6,6,6,6,6},
{
0,6,7,7,7,7,7,7,7,6},
{
0,6,7,8,8,8,8,8,7,6},
{
0,6,7,8,9,9,9,8,7,6},
{
0,6,7,8,9,10,9,8,7,6},
{
0,6,7,8,9,9,9,8,7,6},
{
0,6,7,8,8,8,8,8,7,6},
{
0,6,7,7,7,7,7,7,7,6},
{
0,6,6,6,6,6,6,6,6,6}};
int yu() {