您当前的位置: 首页 >  蓝桥杯

不牌不改

暂无认证

  • 0浏览

    0关注

    422博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

2021蓝桥杯模拟赛-受伤的皇后

不牌不改 发布时间:2022-03-18 21:18:10 ,浏览量:0

题目

题目链接

题解

DFS。

八皇后问题改编而已,加入判断左上三格内和右上三格内是否存在皇后。

代码
#include
using namespace std;

int n, ans;
int col[15], vis[15][15];

bool check (int x, int y) {
	int tx = x, ty = y, cnt = 0;
	while (tx >= 0 && ty >= 0 && cnt = 0 && ty             
关注
打赏
1662186765
查看更多评论
0.0699s