随笔分类 -  数据结构--队列

摘要:题目链接https://www.luogu.com.cn/problem/P4017 知识点:拓扑排序+动态规划 一、刚开始审题不清,误认为是求AOV最长生物链上生物的个数,便出现如下代码 1 #include<bits/stdc++.h> 2 using namespace std; 3 cons 阅读全文
posted @ 2021-05-13 15:57 TFLSNOI 阅读(117) 评论(0) 推荐(0) 编辑
摘要:CCF2020 CSP-j2第二题 https://www.luogu.com.cn/problem/P5661 方法一:纯模拟(40分) 1 #include<bits/stdc++.h> 2 using namespace std; 3 int n, bs[100005], p[100005], 阅读全文
posted @ 2020-10-30 19:30 TFLSNOI 阅读(379) 评论(0) 推荐(0) 编辑
摘要:先把如下代码熟悉,再学习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) 编辑
摘要:有向图、无向图,DFS和BFS的不同遍历方式:https://segmentfault.com/a/1190000010348783 阅读全文
posted @ 2019-08-03 08:16 TFLSNOI 阅读(226) 评论(0) 推荐(0) 编辑
摘要:题目连接(本题目链接失效内容同《围圈报数》):http://ybt.ssoier.cn:8088/problem_show.php?pid=1418 围圈报数链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1334 从队列到循环单链表写了一下午都写 阅读全文
posted @ 2018-12-25 22:20 TFLSNOI 阅读(1744) 评论(3) 推荐(0) 编辑
摘要:题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1360 方法一:BFS 其实这是个最短路问题,于是还可以用以下两种算法 方法二:floyd算法 方法三:dijkstra算法 阅读全文
posted @ 2018-12-25 11:34 TFLSNOI 阅读(722) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1359 【思路分析】这个题属于逆向思维,直接统计围成面积很难,换种思路,将面积以外的所有0点置1再统计0数即为围成面积,这样就转换成4连通块的问题了!当然这儿有个小思考就是外围面积置1时一定要从 阅读全文
posted @ 2018-12-24 20:39 TFLSNOI 阅读(2799) 评论(0) 推荐(0) 编辑
摘要:题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1335 方法一:dfs 方法二:bfs:STL优美展示--笑脸 方法三:并查集???大佬博客传送门 一种题多种写法,深化对算法对理解 【类型题扩展】 四连通》》八连通(什么鬼https://bl 阅读全文
posted @ 2018-12-24 17:06 TFLSNOI 阅读(4545) 评论(0) 推荐(0) 编辑

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