有序线表合并(sf13b) 摘要:解题思路:L1.push_back(x);//容器 L1 的尾部添加元素 x L1.push_front(x)//容器 L1 的首部添加元素 x、L1.merge(L2);//合并,原来有序,合并…… 题解列表 2025年05月29日 0 点赞 0 评论 99 浏览 评分:0.0
队列queue(sf13a) 摘要:解题思路:注意事项:在操作2时,当队列为空时,输出no,且return 0(退出);参考代码:#include<bits/stdc++.h>using namespace std;int …… 题解列表 2025年05月29日 0 点赞 0 评论 97 浏览 评分:0.0
广度优先搜索BFS(cx14c) 摘要:解题思路:参考广度优先搜索BFS(cx14b)注意事项:因为是多组数据,记得清空visited[N][N],即memset(visited, 0, sizeof(visited));参考代…… 题解列表 2025年05月29日 0 点赞 0 评论 118 浏览 评分:0.0
广度优先搜索BFS(cx14a) 摘要:解题思路:从0开始遍历,即从第1行还是查找a[0][i]=1 && visited==0//按行查找矩阵为1,且为没有被遍历的元素//例如第一行的a[0][3]==1 &&am…… 题解列表 2025年05月29日 0 点赞 0 评论 137 浏览 评分:0.0
贪心加二分 摘要:参考代码:#include<iostream>#include<vector>#include<algorithm>usingnamespa…… 题解列表 2025年05月27日 0 点赞 0 评论 160 浏览 评分:0.0
1895队列操作C++ 摘要:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ …… 题解列表 2025年05月25日 0 点赞 0 评论 130 浏览 评分:0.0
1703:BFS广搜 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int a[51][51];int visited[51];int n;…… 题解列表 2025年05月25日 0 点赞 0 评论 141 浏览 评分:0.0
1680: 数据结构-八进制数 摘要:参考代码:#include<iostream>#include<stack>using namespace std;int main() { int num; while (c…… 题解列表 2025年05月20日 0 点赞 0 评论 142 浏览 评分:0.0
STL容器 map 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ map<int,int>mp; i…… 题解列表 2025年05月18日 1 点赞 0 评论 221 浏览 评分:10.0