A1128
Description:
给出一组N皇后问题的序列,判断该序列是否为N皇后问题的解;
思路:
- 设置二维数组标记当前位置能否放置;
- 对于每个要放置的位置,判断当前位置,可放置则标记当前以及主副对角线位置不可放置,不可放置则标记flag;
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<queue>
using namespace std;
const