摘要: #include<bits/stdc++.h> using namespace std; int m, n; char mp[25][25]; int sx, sy, ex, ey; struct node{ //结构体定义位置坐标和起点开始步骤 int x, y, step; }; int dir 阅读全文
posted @ 2020-10-06 20:32 ssdaeda 阅读(311) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; struct node{ int x,y,from; }que[30]; int fx[4][2]={{0,1},{0,-1},{1,0},{-1,0}}; int f,r; int mp[10][10]; v 阅读全文
posted @ 2020-10-06 19:50 ssdaeda 阅读(198) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; struct dt{ int cs,bs; }que[210]; int n,a,b,ans=-1; int yd[205]; int book[205]; int f,r; bool fs=false; vo 阅读全文
posted @ 2020-10-06 19:50 ssdaeda 阅读(200) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int n,m; struct nf{ int x,t; }que[100010]; int f,r; int book[100010]={0}; void move(int nx,int y){ if(nx> 阅读全文
posted @ 2020-10-06 19:04 ssdaeda 阅读(231) 评论(0) 推荐(0) 编辑
摘要: 本题,我用了两种方法,个人认为DFS要更方便一点,至少从代码量来看是这样的 #include<bits/stdc++.h> using namespace std; struct node{ int x,y; }que[12110]; int fx[8][2]={{-1,0},{-1,1},{0,1 阅读全文
posted @ 2020-10-06 10:56 ssdaeda 阅读(429) 评论(2) 推荐(0) 编辑
摘要: 因为这道题的根本性质上就是迷宫模板,所以具体讲解看我的 1215 迷宫 即可 链接:https://www.cnblogs.com/qwn34/p/13732506.html 上代码 BFS() #include<bits/stdc++.h> using namespace std; struct 阅读全文
posted @ 2020-10-06 09:28 ssdaeda 阅读(321) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int ax, ay, bx, by; struct node{ int x, y, step; }; node que[10010]; int f, r; bool book[105][105]; int f 阅读全文
posted @ 2020-10-06 00:03 ssdaeda 阅读(655) 评论(1) 推荐(0) 编辑