随笔分类 - BFS
摘要:先把如下代码熟悉,再学习BFS的框架 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxN=100; 4 int que[maxN];//定义数组模拟队列 5 int f, r;//队首队尾信息 6 int n;//输入数
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1361 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int M=20; 4 int n,k,a[M],b[M]; 5 bool fla
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1362 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, k;//按要求输入 4 int a, b;//按要求输入 5 int rel[1
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1256 1 #include<bits/stdc++.h> 2 using namespace std; 3 int t, row, col; 4 char mp[205][205]; 5 int dir
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1250 此题目难点: 1.利用二进制的与运算判断与隔壁房间是否有墙,从而求出下一步的方向 2.与运算的优先性 3.代码的调试 1 #include<bits/stdc++.h> 2 using names
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1249&teacher=2 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m; 4 char mp[120][120]; 5 int
阅读全文
摘要:题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1257 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, l; 4 int sx, sy; 5 int ex, ey; 6 st
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1360 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, a, b; 4 int k[205]; 5 bool vis[205]; 6 s
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1253 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, k; 4 struct node{ //结构体表示数轴位置和所用时间 5 int
阅读全文
摘要:题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1251 1 #include<bits/stdc++.h> 2 using namespace std; 3 int m, n; 4 char mp[25][25]; 5 int sx, sy,
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1330 1 #include<bits/stdc++.h> 2 using namespace std; 3 int ax, ay, bx, by; 4 struct node{ //结构体标记当前位置坐
阅读全文
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1329 方法一:DFS 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, m; 4 char c; 5 char a[1000][1000
阅读全文
摘要:题目链接http://ybt.ssoier.cn:8088/problem_show.php?pid=1216 方法一:DFS 1 #include<bits/stdc++.h> 2 using namespace std; 3 int w, h; //h代表行数, w代表列数 4 int sx,
阅读全文
摘要:相关题连接: 一本通:http://ybt.ssoier.cn:8088/problem_show.php?pid=1215 小白菜OJ:http://caioj.cn/problem.php?id=1037 一、DFS写法: 问题一:迷宫是否能走通?(http://ybt.ssoier.cn:80
阅读全文