八皇后问题 dfs

要点:将 对角线、列用数组进行标记,加快搜索速度ios #include<iostream> #include<stdio.h> using namespace std; int Max = 0; int m[9][9]; bool A[20] = {false};//右上左下 bool B[20] = {false};//左上右下 bool C[20] = {false};//列 void
相关文章
相关标签/搜索