#include <iostream>
#include <vector>
#include <string>
using namespace std;
bool is_valid(vector<string>& board, int row, int col) {
// Check same column
for (int i = 0; i < row; i++) {
if (board[i][col] == 'Q') {
return false;
}
}
// Check upper right diagonal
for
N皇后问题C++实现
最新推荐文章于 2024-10-20 20:14:58 发布