随笔分类 -  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;//输入数 阅读全文
posted @ 2020-10-04 17:27 TFLSNOI 阅读(219) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-10-03 13:16 TFLSNOI 阅读(682) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-10-02 18:13 TFLSNOI 阅读(1096) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-10-02 12:30 TFLSNOI 阅读(543) 评论(0) 推荐(0) 编辑
摘要:http://ybt.ssoier.cn:8088/problem_show.php?pid=1250 此题目难点: 1.利用二进制的与运算判断与隔壁房间是否有墙,从而求出下一步的方向 2.与运算的优先性 3.代码的调试 1 #include<bits/stdc++.h> 2 using names 阅读全文
posted @ 2020-09-30 21:15 TFLSNOI 阅读(576) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-09-30 15:52 TFLSNOI 阅读(461) 评论(0) 推荐(0) 编辑
摘要:题目链接: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 阅读全文
posted @ 2020-09-30 10:46 TFLSNOI 阅读(383) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-09-30 08:48 TFLSNOI 阅读(761) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-09-29 23:19 TFLSNOI 阅读(704) 评论(0) 推荐(0) 编辑
摘要:题目链接: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, 阅读全文
posted @ 2020-09-29 22:42 TFLSNOI 阅读(909) 评论(0) 推荐(0) 编辑
摘要: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{ //结构体标记当前位置坐 阅读全文
posted @ 2020-09-28 23:25 TFLSNOI 阅读(1368) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2020-09-26 22:55 TFLSNOI 阅读(708) 评论(0) 推荐(0) 编辑
摘要:题目链接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, 阅读全文
posted @ 2020-09-22 11:09 TFLSNOI 阅读(1217) 评论(0) 推荐(0) 编辑
摘要:相关题连接: 一本通:http://ybt.ssoier.cn:8088/problem_show.php?pid=1215 小白菜OJ:http://caioj.cn/problem.php?id=1037 一、DFS写法: 问题一:迷宫是否能走通?(http://ybt.ssoier.cn:80 阅读全文
posted @ 2018-10-03 13:12 TFLSNOI 阅读(468) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示