摘要: #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) 编辑
摘要: #include<bits/stdc++.h> using namespace std; struct node{//新增step以记录所走步数 int x,y,step; }que[2510]; char mp[50][50];//地图 int f,r;//队首,队尾 int n,m;//行列 i 阅读全文
posted @ 2020-10-05 20:36 ssdaeda 阅读(742) 评论(0) 推荐(0) 编辑
摘要: 法一:DFS!!(详细看注释) #include<bits/stdc++.h> using namespace std; int n,m;//行列 char mp[70][70];//地图 int next[4][2]={{-1,0},{1,0},{0,-1},{0,1}};//方向 int ans 阅读全文
posted @ 2020-10-04 21:16 ssdaeda 阅读(291) 评论(2) 推荐(0) 编辑
摘要: http://ybt.ssoier.cn:8088/problem_show.php?pid=1219 #include<bits/stdc++.h> using namespace std; int t;//测试组数 int n, m;//地图行列 int stx, sty;//初始位置 int 阅读全文
posted @ 2020-10-04 20:56 ssdaeda 阅读(123) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; int n,k,sum; char mp[10][10]; bool l[10]; void dfs(int x,int y){ if(y>=k){ sum++; return ; }//每摆完一组棋子,方案加 阅读全文
posted @ 2020-10-04 20:16 ssdaeda 阅读(202) 评论(0) 推荐(0) 编辑