题解列表

筛选

判断第几天c++简单代码

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>//万能头文件using namespace std;int main(){    int y,m,d,a[12]={31,……

链表合并c++ stl

摘要:解题思路:先排序再合并然后重新排序参考代码:#includeusing namespace std; list<pair> a,b; int main() { int n,m; ci……

单链表——约瑟福问题

摘要:解题思路:构建一个单向的环形链表思路1.先创建第一个节点,让First指向该节点,并形成环形2.后面当我们每创建一个新的节点,就把该节点,加入到已有的环形链表中即可。遍历环形链表1.先让一个辅助指针(……

1的个数 C++实现

摘要:```c++ #include #include #include using namespace std; int n; vectornums; int main() { ……

走迷宫(bfs)

摘要:解题思路:很基础的bfs 没什么好说的 看代码即可注意事项:参考代码:#include<iostream> #include<queue> using namespace std; typede……

误落迷宫(dfs)

摘要:解题思路:判断该点是否在环上注意事项:  单项走 只能走过去不能走回来参考代码:#include<iostream> #include<cstring> using namespace std;……

最长单词 保证AC

摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){     string s,s1[100000];    ge……

迷宫问题(bfs)(queue,pair)

摘要:解题思路:通过宽搜  搜出每一个格子起点的距离 最终输出注意事项:  无 本就很简单的题参考代码:#include<iostream> #include<queue> using namespac……

c++string 可直接比较

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