题解列表

筛选

有序线表合并(sf13b)

摘要:解题思路:L1.push_back(x);//容器 L1 的尾部添加元素 x L1.push_front(x)//容器 L1 的首部添加元素 x、L1.merge(L2);//合并,原来有序,合并……

队列queue(sf13a)

摘要:解题思路:注意事项:在操作2时,当队列为空时,输出no,且return 0(退出);参考代码:#include<bits/stdc++.h>using namespace std;int ……

广度优先搜索BFS(cx14c)

摘要:解题思路:参考广度优先搜索BFS(cx14b)注意事项:因为是多组数据,记得清空visited[N][N],即memset(visited, 0, sizeof(visited));参考代……

广度优先搜索BFS(cx14a)

摘要:解题思路:从0开始遍历,即从第1行还是查找a[0][i]=1 && visited==0//按行查找矩阵为1,且为没有被遍历的元素//例如第一行的a[0][3]==1 &&am……

贪心加二分

摘要:参考代码:#include<iostream>#include<vector>#include<algorithm>usingnamespa……

1895队列操作C++

摘要:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ ……

1703:BFS广搜

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int a[51][51];int visited[51];int n;……

STL容器 map

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ map<int,int>mp; i……